Package brave.baggage

Class BaggagePropagationConfig

java.lang.Object
brave.baggage.BaggagePropagationConfig
Direct Known Subclasses:
BaggagePropagationConfig.SingleBaggageField

public class BaggagePropagationConfig
extends Object
Holds BaggagePropagation configuration.

Field mapping

Your log correlation properties may not be the same as the baggage field names. You can override them with the builder as needed.

Ex. If your log property is %X{trace-id}, you can do this:


 import brave.baggage.BaggagePropagationConfig.SingleBaggageField;

 scopeBuilder.clear() // TRACE_ID is a default field!
             .add(SingleBaggageField.newBuilder(BaggageFields.TRACE_ID)
                                        .name("trace-id").build())
 

NoteAt the moment, dynamic fields are not supported. Use BaggagePropagationConfig.SingleBaggageField for each field you need to propagate.

Since:
5.11
See Also:
BaggagePropagation, BaggageField, BaggagePropagationConfig, BaggagePropagationCustomizer