-
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
Changes from all commits
6e2d404
df45912
334c543
c347e32
50d77ed
bf96214
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "id": "ec884c41-7bda-4033-a80b-5da20836a64b", | ||
| "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" | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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()) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we set up tests to confirm this is working as expected?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| block(span) | ||
| } | ||
| } catch (ex: Exception) { | ||
|
|
||
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