Module Trace_context.Traceparent

The traceparent header https://www.w3.org/TR/trace-context/#traceparent-header

val name : string
val of_value : ?trace_state:string -> string -> (Span_ctx.t, string) result

Parse the value of the traceparent header.

The values are of the form:

  { version } - { trace_id } - { parent_id } - { flags }

For example:

  00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01

Only the known bits of {flags} are kept (see Trace_flags). The result is a Span_ctx.t carrying trace_state (the tracestate header value).

  • since 0.92 returns a {!Span_ctx.t}
val to_value : trace_flags:Trace_flags.t -> trace_id:Trace_id.t -> parent_id:Span_id.t -> unit -> string
  • since 0.92 takes a mandatory [~trace_flags] instead of

?sampled