Package brave.propagation
Class SamplingFlags
java.lang.Object
brave.propagation.SamplingFlags
- Direct Known Subclasses:
TraceContext,TraceIdContext
public class SamplingFlags extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSamplingFlags.BuilderDeprecated.prefer using constants. -
Field Summary
Fields Modifier and Type Field Description static SamplingFlagsDEBUGstatic SamplingFlagsEMPTYstatic SamplingFlagsNOT_SAMPLEDstatic SamplingFlagsSAMPLED -
Method Summary
Modifier and Type Method Description booleandebug()True impliessampled(), and is additionally a request to override any storage or collector layer sampling.Booleansampled()Sampled means send span data to Zipkin (or something else compatible with its data).booleansampledLocal()True records this trace locally even if it is notsampled downstream.StringtoString()
-
Field Details
-
Method Details
-
sampled
Sampled means send span data to Zipkin (or something else compatible with its data). It is a consistent decision for an entire request (trace-scoped). For example, the value should not move from true to false, even if the decision itself can be deferred.Here are the valid options:
- True means the trace is reported, starting with the first span to set the value true
- False means the trace should not be reported
- Null means the decision should be deferred to the next hop
Once set to true or false, it is expected that this decision is propagated and honored downstream.
Note: sampling does not imply the trace is invisible to others. For example, a common practice is to generate and propagate identifiers always. This allows other systems, such as logging, to correlate even when the tracing system has no data.
-
sampledLocal
public final boolean sampledLocal()True records this trace locally even if it is notsampled downstream. Defaults to false.Note: Setting this does not affect
remote sampled status.The use case for this is storing data at other sampling rates, or local aggregation of metrics or service aggregations. How to action this data may or may not require inspection of
other propagated information. -
debug
public final boolean debug()True impliessampled(), and is additionally a request to override any storage or collector layer sampling. Defaults to false. -
toString
-