Crate tracing_distributed[][src]

This crate provides:

  • TelemetryLayer, a generic tracing layer that handles publishing spans and events to arbitrary backends
  • Utilities for implementing distributed tracing for arbitrary backends

As a tracing layer, TelemetryLayer can be composed with other layers to provide stdout logging, filtering, etc.

This crate is primarily intended to be used by people implementing their own backends. A concrete implementation using honeycomb.io as a backend is available in the tracing-honeycomb crate.

Structs

BlackholeTelemetry

Telemetry implementation that does not publish information to any backend. For use in tests.

Event

An Event holds ready-to-publish information derived from a tracing::Event.

Span

A Span holds ready-to-publish information gathered during the lifetime of a tracing::Span.

TelemetryLayer

A tracing_subscriber::Layer that publishes events and spans to some backend using the provided Telemetry capability.

Enums

TraceCtxError

Errors that can occur while registering the current span as a distributed trace root or attempting to retrieve the current trace context.

Traits

Telemetry

Represents the ability to publish events and spans to some arbitrary backend.

Functions

current_dist_trace_ctx

Retrieve the distributed trace context associated with the current span. Returns the TraceId, if any, that the current span is associated with along with the SpanId belonging to the current span.

register_dist_tracing_root

Register the current span as the local root of a distributed trace.