How to get agent generated traceId and span Id, programatically #12228
Answered
by
jaydeluca
annaik-mdsol
asked this question in
Q&A
-
Hi I want to get agent generated traceId and spanId programatically. I want to add traceId and span Id in response header. |
Beta Was this translation helpful? Give feedback.
Answered by
jaydeluca
Sep 12, 2024
Replies: 1 comment
-
You can use the java SDK API in your application to get this information. Example: Span span = Span.current();
SpanContext spanContext = span.getSpanContext();
String traceId = spanContext.getTraceId();
String spanId = spanContext.getSpanId(); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
annaik-mdsol
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use the java SDK API in your application to get this information.
Example: