Correct Use of Baggage #6714
Unanswered
codeforaliving
asked this question in
Q&A
Replies: 1 comment 3 replies
-
hi @codeforaliving do you have profiles or stack traces showing where the bottleneck/deadlock occurred? |
Beta Was this translation helpful? Give feedback.
3 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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, we are currently using Baggage to shuttle a transaction id from our main service and ultimately adding the value as a span attribute in a custom SpanProcessor extension. The extension has been working well, however when we added logic to insert a transaction id into Baggage, the server experienced increased latency and a possible deadlock. We are using OTEL agent v1.12.0.
Is this the correct way to use Baggage?
Main Java Service (insert):
Baggage.current().toBuilder().put("my-transaction-id", "some-transaction-id").build().storeInContext(Context.current()).makeCurrent();
SpanProcessor Extension (get):
... Baggage baggage = Baggage.fromContextOrNull(parentContext); if (baggage != null) { String txId = baggage.getEntryValue("my-transaction-id"); .... }
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions