opentracing with traceId and spanId in log lines

1,613 views
Skip to first unread message

Jimmy Falkbjer

unread,
Nov 10, 2019, 12:33:41 PM11/10/19
to Quarkus Development mailing list
Hi,

I added the opentracing extension to my Quarkus application and it all works great with Jaeger.
But when it comes to my log lines I'm not able to get the traceId and spanId. The MDC is empty.
Is this expected and not part of the opentracing extension?

I'm coming from a SpringBoot environment and I'm trying to mimic what I get there, like:
2019-11-10 18:15:35.134 DEBUG [-,fc22278bf95669fc2146348259d7ffd7,c6d486b76d409b25,true] 58569 --- [nio-8082-exec-1] .s.r.a.SomeClass : some message

So basically what I want to configure is something like:
quarkus.log.console.format=%d{yyyy-MM-dd HH:mm:ss.SSS} %5p [-,%X{X-B3-TraceId:-},%X{X-B3-SpanId:-},%X{X-Span-Export:-}] %i --- [%15.15t] %c{2.} : %s%e%n

Anyone has some information to share?

Thanks!


Br
Jimmy

Pavol Loffay

unread,
Dec 19, 2019, 11:58:26 AM12/19/19
to Quarkus Development mailing list
Hi Jimmy,

I have submitted PR https://github.com/quarkusio/quarkus/pull/6274 that adds this capability to Quarkus via Jaeger extension. 
If you have any feedback please comment on the PR.

Regards,

Pavol Loffay

unread,
Dec 20, 2019, 5:14:39 AM12/20/19
to Quarkus Development mailing list
If there is interest we can add baggage/distributed context into MDC in the next iteration. Let us know if this feature is something you are also interested in.

Jimmy Falkbjer

unread,
Dec 21, 2019, 5:01:38 AM12/21/19
to Quarkus Development mailing list
Hi Pavol,

That is great news!
Unfortunately I'm on vacation, without computer, so I'll have to wait until the 27th to try it out.
But now I have something to look forward to when getting home again.

Thanks again!


Br
Jimmy

Jimmy Falkbjer

unread,
Dec 21, 2019, 5:09:25 AM12/21/19
to Quarkus Development mailing list
Hi,

We are not using the baggage/distributed context today, so no rush on my behalf.
Thanks for asking.


Br
Jimmy
Message has been deleted

Ibrahim abed al aziz

unread,
Mar 6, 2020, 12:12:21 PM3/6/20
to Quarkus Development mailing list
I am trying to do the same functionality with Quarkus 1.2.1.final version. I've added property "quarkus.jaeger.log-trace-context=true" in my application.properties and tried the below format :

quarkus.log.console.format=%d{yyyy-MM-dd HH:mm:ss.SSS} %5p [-,%X{traceId:-},%X{spanId:-},%X{sampled:-}] %i --- [%15.15t] %c{2.} : %s%e%n


but it didn't work. What i am missing here ?

Jimmy Falkbjer

unread,
Mar 6, 2020, 1:04:05 PM3/6/20
to Quarkus Development mailing list
I'm using the syntax below, and it works for me:
quarkus.log.console.format=%d{yyyy-MM-dd HH:mm:ss.SSS} %5p [%X{traceId},%X{spanId},%X{sampled}] %i --- [%15.15t] %c{2.} : %s%e%n

You see that I have removed :- from the syntax compared with yours.

Hope that work for you.


Br
Jimmy

Jimmy Falkbjer

unread,
Mar 6, 2020, 1:11:00 PM3/6/20
to Quarkus Development mailing list
Note that I also specify this property:
quarkus.jaeger.propagation=b3

Value can also be jaeger.


/Jimmy

Ibrahim abed al aziz

unread,
Mar 6, 2020, 1:12:03 PM3/6/20
to Quarkus Development mailing list
What is the difference between b3 and Jaeger values?

Jimmy Falkbjer

unread,
Mar 6, 2020, 1:24:34 PM3/6/20
to Quarkus Development mailing list
It is different formats to achieve distributed tracing.
b3 i is the Zipkin format. Read about it here:

And jaeger is using the OpenTracing format.

Note that Jaeger can manage both formats.


Br
Jimmy

Emmanuel Bernard

unread,
Mar 9, 2020, 4:24:30 AM3/9/20
to jimmy.f...@gmail.com, Pavol Loffay, Quarkus Development mailing list
Hey Pavol, probably a thread you want to keep a eye on (for doc or code improvement)

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/32e11562-1e3e-4509-beb6-af0812363db2%40googlegroups.com.

Pavol Loffay

unread,
Mar 9, 2020, 4:35:57 AM3/9/20
to Emmanuel Bernard, jimmy.f...@gmail.com, Quarkus Development mailing list
Hi Emmanuel,

any suggestion where "trace" MDC should be documented? 

A couple of notes:
* B3 and Jaeger and context propagation formats. These formats are used to encode/decode trace IDs sent on the wire(between services).  For instance Istio uses B3, therefore all deployments should agree on this protocol. 
* The context propagation formats are usually pluggable.
* Context propagation format does not have any effect on the MDC logging.



--

Pavol Loffay

Senior Software Engineer

M: +41791562647    

Emmanuel Bernard

unread,
Mar 9, 2020, 5:09:28 AM3/9/20
to Pavol Loffay, jimmy.f...@gmail.com, Quarkus Development mailing list

Pavol Loffay

unread,
Mar 9, 2020, 5:22:11 AM3/9/20
to Emmanuel Bernard, jimmy.f...@gmail.com, Quarkus Development mailing list
Thanks, I will submit a PR shortly. 

Pavol Loffay

unread,
Mar 10, 2020, 8:35:17 AM3/10/20
to Emmanuel Bernard, jimmy.f...@gmail.com, Quarkus Development mailing list
Reply all
Reply to author
Forward
0 new messages