-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added BatchSpanProcessor metrics on drop and export span #635
base: main
Are you sure you want to change the base?
Added BatchSpanProcessor metrics on drop and export span #635
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm following Java SDK implementation from here
Sources/OpenTelemetrySdk/Trace/SpanProcessors/BatchSpanProcessor.swift
Outdated
Show resolved
Hide resolved
Sources/OpenTelemetrySdk/Trace/SpanProcessors/BatchSpanProcessor.swift
Outdated
Show resolved
Hide resolved
Sources/OpenTelemetrySdk/Trace/SpanProcessors/BatchSpanProcessor.swift
Outdated
Show resolved
Hide resolved
d910005
to
fd4b7e7
Compare
Looks good, I'll approve it after you add the |
Sources/OpenTelemetrySdk/Trace/SpanProcessors/BatchSpanProcessor.swift
Outdated
Show resolved
Hide resolved
Sources/OpenTelemetrySdk/Trace/SpanProcessors/BatchSpanProcessor.swift
Outdated
Show resolved
Hide resolved
4522a0b
to
b41c887
Compare
deinit { | ||
// Cleanup all gauge observer | ||
self.queueSizeGauge?.close() | ||
self.spanGaugeObserver?.close() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean up here cc: @bryce-b
spanList.append(span) | ||
|
||
// If there is any observer before, let's close it | ||
self.spanGaugeObserver?.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean up if anything present cc: @bryce-b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being late, but I have some questions about the new protocol functions and how they match in the API/SDK
I followed exactly how it defined in the Java SDK. We can discuss more today's session |
Sources/OpenTelemetryApi/Metrics/Stable/LongCounterBuilder.swift
Outdated
Show resolved
Hide resolved
Sources/OpenTelemetrySdk/Metrics/Stable/LongCounterMeterBuilderSdk.swift
Outdated
Show resolved
Hide resolved
Sources/OpenTelemetrySdk/Metrics/Stable/LongGaugeBuilderSdk.swift
Outdated
Show resolved
Hide resolved
b41c887
to
6e92546
Compare
extension LongGaugeBuilder { | ||
public func asLongSdk() throws -> LongGaugeBuilderSdk { | ||
guard let sdkType = self as? LongGaugeBuilderSdk else { | ||
throw GuageError.invalidType | ||
} | ||
return sdkType | ||
} | ||
} | ||
|
||
extension LongCounterBuilder { | ||
public func asLongSdk() throws -> LongCounterMeterBuilderSdk { | ||
guard let sdkType = self as? LongCounterMeterBuilderSdk else { | ||
throw GuageError.invalidType | ||
} | ||
return sdkType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added helper function here to address the type conversion
Added BatchSpanProcessor metrics on drop and export span