-
Notifications
You must be signed in to change notification settings - Fork 130
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
use onEnding to add baggage keys that are added while the span is active #1633
base: main
Are you sure you want to change the base?
use onEnding to add baggage keys that are added while the span is active #1633
Conversation
I'm not sure there is any difference? (sort of related to open-telemetry/opentelemetry-java-instrumentation#12952) |
can you elaborate? |
sorry, I'm wondering why this change is needed? can you give a concrete example of when this implementation would have different behavior from existing implementation? |
When a baggage item is added after span start: Span span = sdk.getTracer("test").spanBuilder("test").startSpan();
try (Scope unused = span.makeCurrent()) {
try (Scope scope = Baggage.current().toBuilder().put("key", "value").build()
.makeCurrent()) {
span.end();
}
} |
yeah, but that doesn't work when we follow open-telemetry/opentelemetry-java-instrumentation#12952 |
OK - so you're saying that this feature should not be implemented because it would not work for users that use the agent - and that would be surprising? |
yeah, I'm not convinced we should make this change since I think "best practice" is to end span after closing scope also I realized this change will cause the processor to break for people who are passing context manually instead of using thread local |
I think that's a good argument - I'll add it to the issue |
Fixes #1632