package opentelemetry

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Opentelemetry_core.Trace_flagsSource

W3C trace flags.

https://www.w3.org/TR/trace-context-2/#trace-flags

Only the sampled (0x01) and random-trace-id (0x02) flags are defined; other bits are reserved and "Vendors MUST set those to zero", so they are always cleared.

  • since 0.92
Sourcetype t = private int
Sourceval none : t

No flag set

Sourceval sampled : t

Only the sampled flag

Sourceval default : t

sampled and random (0x03). Default for Span.make, and for spans without flags

Sourceval make : sampled:bool -> random:bool -> t
Sourceval of_int : int -> t

Keep only the known flags

Sourceval to_int : t -> int
Sourceval of_int32 : int32 -> t

Keep only the known flags, e.g. from the OTLP flags field

Sourceval to_int32 : t -> int32
Sourceval is_sampled : t -> bool

"When set, the least significant bit (right-most), denotes that the caller may have recorded trace data."

Sourceval is_random : t -> bool

"When set, at least the right-most 7 bytes of the trace-id MUST be selected randomly (or pseudo-randomly)". It must be propagated unchanged for a given trace ID.

Sourceval with_sampled : bool -> t -> t
Sourceval with_random : bool -> t -> t
Sourceval pp : Format.formatter -> t -> unit