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 producesSdkTracer
s.
Re-exports§
pub use in_memory_exporter::InMemorySpanExporter;
testing
ortest
pub use in_memory_exporter::InMemorySpanExporterBuilder;
testing
ortest
Modules§
- in_
memory_ exporter testing
ortest
- In-Memory span exporter for testing purpose.
- span_
processor_ with_ async_ runtime experimental_trace_batch_span_processor_with_async_runtime
- Experimental feature to use async runtime with batch span processor.
Structs§
- Batch
Config - Batch span processor configuration.
Use
BatchConfigBuilder
to configure your own instance ofBatchConfig
. - Batch
Config Builder - A builder for creating
BatchConfig
instances. - Batch
Span Processor - The
BatchSpanProcessor
collects finished spans in a buffer and exports them in batches to the configuredSpanExporter
. 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. - Batch
Span Processor Builder - Builder for
BatchSpanProcessorDedicatedThread
. - Config
- Tracer configuration
- Jaeger
Remote Sampler - Sampler that fetches the sampling configuration from remotes.
- Jaeger
Remote Sampler Builder - Builder for
JaegerRemoteSampler
. See Sampler::jaeger_remote for details. - Random
IdGenerator - Default
IdGenerator
implementation. - SdkTracer
Tracer
implementation to create and manage spans- SdkTracer
Provider - Creator and registry of named
SdkTracer
instances. - Simple
Span Processor - 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.
- Span
Data SpanData
contains all the information collected by aSpan
and can be used by exporters as a standard input.- Span
Events - Stores span events along with dropped count.
- Span
Limits - Span limit configuration to keep attributes, events and links to a span in a reasonable number.
- Span
Links - Stores span links along with dropped count.
- Tracer
Tracer
implementation to create and manage spans- Tracer
Provider Builder - Builder for provider attributes.
Enums§
- Sampler
- Default Sampling options
- Trace
Error - Errors returned by the trace API.
Traits§
- IdGenerator
- Interface for generating IDs
- Should
Sample - The
ShouldSample
interface allows implementations to provide samplers which will return a samplingSamplingResult
based on information that is typically available just before theSpan
was created. - Span
Exporter 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.- Span
Processor 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§
- Trace
Result - A specialized
Result
type for trace operations.