Skip to content

How to get agent generated traceId and span Id, programatically #12228

Answered by jaydeluca
annaik-mdsol asked this question in Q&A
Discussion options

You must be logged in to vote

I want to get agent generated traceId and spanId programatically

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();

Replies: 1 comment

Comment options

You must be logged in to vote
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
Category
Q&A
Labels
None yet
2 participants