openzipkin / brave

Java distributed tracing implementation compatible with Zipkin backend services.
Apache License 2.0
2.36k stars 713 forks source link

Local correlation fields not logged #1376

Open grassehh opened 1 year ago

grassehh commented 1 year ago

Describe the Bug

Hello, as I understand and as explained in Micrometer Tracing, correlation fields should be logged in the tracing context (i.e SFL4J MDC).

The issue is that using brave implementation requires them to be defined as remote fields in order to be logged in the MDC.

Steps to Reproduce

You will see that only the standard traceId and spanId baggages are logged. If you edit the application.yaml file and uncomment the following configuration:

      remote-fields:
        - myBaggageFilter
        - myBaggageController

The custom baggages myBaggageFilterand myBaggageController are now correctly logged.

Expected Behaviour

The custom baggages myBaggageFilterand myBaggageController should be logged without being declared as remote fields.

Thanks for the help.