Class B3SingleFormat


public final class B3SingleFormat
extends Object
This format corresponds to the propagation key "b3" (or "B3"), which delimits fields in the following manner.

 b3: {x-b3-traceid}-{x-b3-spanid}-{if x-b3-flags 'd' else x-b3-sampled}-{x-b3-parentspanid}

For example, a sampled root span would look like: 4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-1

... a not yet sampled root span would look like: 4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7

... and a debug RPC child span would look like: 4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-d-5b4185666d50f68b

Like normal B3, it is valid to omit trace identifiers in order to only propagate a sampling decision. For example, the following are valid downstream hints:

  • don't sample - b3: 0
  • sampled - b3: 1
  • debug - b3: d
Reminder: debug (previously X-B3-Flags: 1), is a boosted sample signal which is recorded to ensure it reaches the collector tier. See SamplingFlags.debug().

See B3 Propagation