Module trace

Source
Available on crate feature trace only.
Expand description

§OpenTelemetry Trace SDK

The tracing SDK consist of a few main structs:

  • The SdkTracer struct which performs all tracing operations.
  • The Span struct with is a mutable object storing information about the current operation execution.
  • The SdkTracerProvider struct which configures and produces SdkTracers.

Re-exports§

pub use in_memory_exporter::InMemorySpanExporter;testing or test
pub use in_memory_exporter::InMemorySpanExporterBuilder;testing or test

Modules§

in_memory_exportertesting or test
In-Memory span exporter for testing purpose.
span_processor_with_async_runtimeexperimental_trace_batch_span_processor_with_async_runtime
Experimental feature to use async runtime with batch span processor.

Structs§

BatchConfig
Batch span processor configuration. Use BatchConfigBuilder to configure your own instance of BatchConfig.
BatchConfigBuilder
A builder for creating BatchConfig instances.
BatchSpanProcessor
The BatchSpanProcessor collects finished spans in a buffer and exports them in batches to the configured SpanExporter. This processor is ideal for high-throughput environments, as it minimizes the overhead of exporting spans individually. It uses a dedicated background thread to manage and export spans asynchronously, ensuring that the application’s main execution flow is not blocked.
BatchSpanProcessorBuilder
Builder for BatchSpanProcessorDedicatedThread.
Config
Tracer configuration
JaegerRemoteSampler
Sampler that fetches the sampling configuration from remotes.
JaegerRemoteSamplerBuilder
Builder for JaegerRemoteSampler. See Sampler::jaeger_remote for details.
RandomIdGenerator
Default IdGenerator implementation.
SdkTracer
Tracer implementation to create and manage spans
SdkTracerProvider
Creator and registry of named SdkTracer instances.
SimpleSpanProcessor
A SpanProcessor that passes finished spans to the configured SpanExporter, as soon as they are finished, without any batching. This is typically useful for debugging and testing. For scenarios requiring higher performance/throughput, consider using BatchSpanProcessor. Spans are exported synchronously in the same thread that emits the log record. When using this processor with the OTLP Exporter, the following exporter features are supported:
Span
Single operation within a trace.
SpanData
SpanData contains all the information collected by a Span and can be used by exporters as a standard input.
SpanEvents
Stores span events along with dropped count.
SpanLimits
Span limit configuration to keep attributes, events and links to a span in a reasonable number.
SpanLinks
Stores span links along with dropped count.
Tracer
Tracer implementation to create and manage spans
TracerProviderBuilder
Builder for provider attributes.

Enums§

Sampler
Default Sampling options
TraceError
Errors returned by the trace API.

Traits§

IdGenerator
Interface for generating IDs
ShouldSample
The ShouldSample interface allows implementations to provide samplers which will return a sampling SamplingResult based on information that is typically available just before the Span was created.
SpanExporter
SpanExporter defines the interface that protocol-specific exporters must implement so that they can be plugged into OpenTelemetry SDK and support sending of telemetry data.
SpanProcessor
SpanProcessor is an interface which allows hooks for span start and end method invocations. The span processors are invoked only when is_recording is true.

Type Aliases§

TraceResult
A specialized Result type for trace operations.