-
Notifications
You must be signed in to change notification settings - Fork 30
fix: replace Span.makeCurrent()
with Span.asContextElement()
#1237
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
Conversation
This comment has been minimized.
This comment has been minimized.
3 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Affected ArtifactsChanged in size
|
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.
Question: Do we need to update our Micrometer implementation too?
@@ -71,7 +71,7 @@ public suspend inline fun <R> withSpan( | |||
// or else traces may be disconnected from their parent | |||
val updatedCtx = coroutineContext[TelemetryProviderContext]?.provider?.contextManager?.current() | |||
val telemetryCtxElement = (updatedCtx?.let { TelemetryContextElement(it) } ?: coroutineContext[TelemetryContextElement]) ?: EmptyCoroutineContext | |||
withContext(context + TraceSpanContext(span) + telemetryCtxElement) { | |||
withContext(context + TraceSpanContext(span) + telemetryCtxElement + span.asContextElement()) { |
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.
Should we set up tests to confirm this is working as expected?
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.
This is a very complex setup, involving two Docker containers and a lot of visual inspection. I'm not sure setting up unit tests would be worth the effort
"type": "bugfix", | ||
"description": "Fix OpenTelemetry span concurrency by using Span.asContextElement() instead of Span.makeCurrent()", | ||
"issues": [ | ||
"https://github.com/smithy-lang/smithy-kotlin/issues/1211" |
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.
Nit: We could mention the issue in the pull request description as well
No we don't, because Micrometer doesn't have a |
Issue #
Description of changes
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.