Propagate trace_id on logback using Http4s

62 views Asked by At

I'm currently facing an issue while attempting to propagate the trace_id and span_id in my logback.xml file using http4s and Scala. Unfortunately, the variables appear to be empty.

To provide some context, I'm employing the OpenTelemetry auto-instrumentation (https://opentelemetry.io/docs/kubernetes/operator/automatic/) to implement tracing support over the http4s server.

Here's a snippet of my logback.xml encoding setup:

<encoder>
   <pattern>%highlight(%-5level) %-13(%d{HH:mm:ss.SSS}) %green(%logger{45}) TraceID=%X{trace_id}  SpanID=%X{span_id} - %message%n%xException{10}</pattern>
</encoder>

Despite my efforts, I've also attempted to change the variable names, such as trace.id, but the result remains unchanged.

Any suggestions on how to address this issue would be greatly appreciated.

Thanks in advance.

0

There are 0 answers