instana / instana-java-opentracing

Instana Java OpenTracing
MIT License
20 stars 6 forks source link

InstanaTracer "extract" method always returning null. #12

Closed dejan-kosak closed 1 year ago

dejan-kosak commented 1 year ago

extract method on InstanaTracer class, is always returning null, from what I observe when I debug my code, and when going thru the code of this project.

What I checked: extract method is calling extractContext, which will return TextMapContext for Format.Builtin.TEXT_MAP_EXTRACT. https://github.com/instana/instana-java-opentracing/blob/81272deebbdfaef87a159f3486c66d0e947e1589/src/main/java/com/instana/opentracing/InstanaTracer.java#L126

Then call for toTraceId on TextMapContext https://github.com/instana/instana-java-opentracing/blob/81272deebbdfaef87a159f3486c66d0e947e1589/src/main/java/com/instana/opentracing/InstanaTracer.java#L127

will return "". https://github.com/instana/instana-java-opentracing/blob/81272deebbdfaef87a159f3486c66d0e947e1589/src/main/java/com/instana/opentracing/TextMapContext.java#L34

Because of that null is returned. I would expect toTraceId to return trace id from baggageItems, which are extracted from Instana headers x-instana-....

dejan-kosak commented 1 year ago

Problem was Java 21, current agent does not support it yet.