Skip to content

[Otel] fix otel baggage prop#12665

Open
AgraVator wants to merge 8 commits intogrpc:masterfrom
AgraVator:otel-baggage-context
Open

[Otel] fix otel baggage prop#12665
AgraVator wants to merge 8 commits intogrpc:masterfrom
AgraVator:otel-baggage-context

Conversation

@AgraVator
Copy link
Contributor

No description provided.

@AgraVator AgraVator marked this pull request as ready for review February 26, 2026 11:11
@AgraVator AgraVator requested a review from ejona86 February 26, 2026 11:11
streamPlugins = Collections.unmodifiableList(streamPluginsMutable);
}
return new ServerTracer(OpenTelemetryMetricsModule.this, fullMethodName, streamPlugins);
Context context = contextPropagators.getTextMapPropagator().extract(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is being done by the OpenTelemetryTracingModule and is being propagated via filterContext(), specifically so it can be used by the metrics module. If we want the full context, propagate that instead. I don't understand the goal here (and there's no description about why we're doing this in the PR description or a comment from what I can tell). And I'm doubly confused by using this context directly half the time and copying BAGGAGE_KEY into it other times.


void recordFinishedAttempt() {
Context otelContext = otelContextWithBaggage();
Context otelContext = otelContextWithBaggage(BAGGAGE_KEY.get());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no guaranteed Context as this point. I think this is only working because you're using in-process, which calls the StatsTraceContext on the calling thread. If the test used Netty instead, I suspect the baggage would no longer be found.

@AgraVator AgraVator requested a review from ejona86 March 2, 2026 13:00
Copy link
Member

@ejona86 ejona86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're iterating further away from something appropriate. We shouldn't add the baggage to our attributes.

@ejona86
Copy link
Member

ejona86 commented Mar 2, 2026

I think we're iterating further away from something appropriate. We shouldn't add the baggage to our attributes.

Take a look at #12671

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants