Skip to main content

Crate krabka_trace_context

Crate krabka_trace_context 

Source
Expand description

W3C Trace Context propagation shared by Krabka’s wire-protocol crates.

This crate is the single place where a trace context crosses a Krabka process boundary. It covers the three shapes those boundaries take:

This crate deliberately depends on nothing but opentelemetry, tracing, tracing-opentelemetry, and serde. The OTLP exporter, its configuration, and the process-wide subscriber live in krabka-telemetry. That crate is unpublished, and it pulls in a web server, a CLI parser, and a profiler. None of those belong in a crate that a protocol codec links against. krabka-telemetry re-exports this crate as krabka_telemetry::propagation.

This crate validates ingress from an untrusted client. See TraceCarrier::from_w3c for the exact rules, and for the reason it never keeps the raw client string.

Structs§

SqlCommenterTrace
A trace context read out of a sqlcommenter tag, borrowed from the statement.
TraceCarrier
A W3C trace context in transit, sized to fit in a request payload.

Enums§

TraceContextError
Why Krabka rejected a client-supplied W3C trace context.

Constants§

TRACEPARENT
The canonical W3C trace-context header keys.
TRACESTATE

Functions§

current_trace_headers
The W3C trace-context headers for the current tracing span.
extract_context
Rebuild an OpenTelemetry Context from Kafka record headers.
extract_sqlcommenter
Extract a sqlcommenter trace context from sql, if it carries one.
set_remote_parent
Make span a child of the trace that headers carries.