How coud i get baggage in SpanExporter? #3877
Unanswered
mijingling
asked this question in
Q&A
Replies: 1 comment
-
Hi @mijingling . There is no way to get access to Baggage in an exporter. If you need to append Baggage entries to a Span, the best place for that is in a SpanProcessor, which does have access to the span's Context, and hence the Baggage. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
I could get baggage in application, but i can't get baggage in SpanExporter
How coud i get baggage in SpanExporter?
get baggage in SpanExporter
public class MySpanExporter implements SpanExporter {
@OverRide
public CompletableResultCode export(Collection spans) {
String tradeCode = Baggage.current().getEntryValue("trade_code");
// but tradeCode is null , How coud i get baggage in SpanExporter?
return CompletableResultCode.ofSuccess();
}
...
}
thanks very much^^
Beta Was this translation helpful? Give feedback.
All reactions