Package brave.baggage
Class CorrelationScopeConfig.SingleCorrelationField
java.lang.Object
brave.baggage.CorrelationScopeConfig
brave.baggage.CorrelationScopeConfig.SingleCorrelationField
- Enclosing class:
- CorrelationScopeConfig
public static class CorrelationScopeConfig.SingleCorrelationField extends CorrelationScopeConfig
Holds
CorrelationScopeDecorator
configuration for a baggage
field.
Visibility
By default, field updates only apply during scope
decoration. This means values set do not flush immediately to the underlying correlation
context. Rather, they are scheduled for the next scope operation as a way to control overhead.
flushOnUpdate()
overrides this.
- Since:
- 5.11
- See Also:
CorrelationScopeDecorator
,BaggageField
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CorrelationScopeConfig.SingleCorrelationField.Builder
Nested classes/interfaces inherited from class brave.baggage.CorrelationScopeConfig
CorrelationScopeConfig.SingleCorrelationField
-
Method Summary
Modifier and Type Method Description BaggageField
baggageField()
static CorrelationScopeConfig.SingleCorrelationField
create(BaggageField baggageField)
boolean
dirty()
Adds a name in the underlying context which is updated directly.boolean
equals(Object o)
Returns true for any config with the same baggage field.boolean
flushOnUpdate()
When true, updates made to this name via BaggageField.updateValue(TraceContext, String) flush immediately to the correlation context.int
hashCode()
Returns the same value for any config with the same baggage field.String
name()
The name to use in the correlation context.static CorrelationScopeConfig.SingleCorrelationField.Builder
newBuilder(BaggageField baggageField)
boolean
readOnly()
Returns true if this value is immutable within aTraceContext
.CorrelationScopeConfig.SingleCorrelationField.Builder
toBuilder()
Allows decorators to reconfigure correlation of thisbaggageField()
String
toString()
-
Method Details
-
create
- Since:
- 5.11
-
newBuilder
public static CorrelationScopeConfig.SingleCorrelationField.Builder newBuilder(BaggageField baggageField)- Since:
- 5.11
-
toBuilder
Allows decorators to reconfigure correlation of thisbaggageField()
- Since:
- 5.11
- See Also:
CorrelationScopeCustomizer
-
baggageField
-
name
The name to use in the correlation context. This defaults toBaggageField.name()
unless overridden byCorrelationScopeConfig.SingleCorrelationField.Builder.name(String)
.- Since:
- 5.11
-
dirty
public boolean dirty()Adds a name in the underlying context which is updated directly. The decorator will overwrite any underlying changes when the scope closes.This is used when there are a mix of libraries controlling the same correlation field. For example, if SLF4J MDC can update the same field name.
This has a similar performance impact to
flushOnUpdate()
, as it requires tracking the field value even if there's no change detected.- Since:
- 5.11
-
flushOnUpdate
public boolean flushOnUpdate()When true, updates made to this name via BaggageField.updateValue(TraceContext, String) flush immediately to the correlation context.This is useful for callbacks that have a void return. Ex.
{@code
- Since:
- 5.11
-
readOnly
public boolean readOnly()Returns true if this value is immutable within aTraceContext
. -
toString
-
equals
Returns true for any config with the same baggage field. -
hashCode
public int hashCode()Returns the same value for any config with the same baggage field.
-