Package brave.baggage

Class CorrelationScopeConfig

java.lang.Object
brave.baggage.CorrelationScopeConfig
Direct Known Subclasses:
CorrelationScopeConfig.SingleCorrelationField

public class CorrelationScopeConfig
extends Object
Holds CorrelationScopeDecorator 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.CorrelationScopeConfig.SingleCorrelationField;

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

NoteAt the moment, dynamic fields are not supported. Use CorrelationScopeConfig.SingleCorrelationField for each field you need in the correlation context.

Since:
5.11
See Also:
CorrelationScopeDecorator, BaggageField