Expand description
§OpenTelemetry Trace SDK
The tracing SDK consist of a few main structs:
- The
SdkTracerstruct which performs all tracing operations. - The
Spanstruct with is a mutable object storing information about the current operation execution. - The
SdkTracerProviderstruct which configures and producesSdkTracers.
Structs§
- Batch
Config - Batch span processor configuration.
Use
BatchConfigBuilderto configure your own instance ofBatchConfig. - Batch
Config Builder - A builder for creating
BatchConfiginstances. - Batch
Span Processor - The
BatchSpanProcessorcollects 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
- Random
IdGenerator - Default
IdGeneratorimplementation. - SdkTracer
Tracerimplementation to create and manage spans- SdkTracer
Provider - Creator and registry of named
SdkTracerinstances. - 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 SpanDatacontains all the information collected by aSpanand 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
Tracerimplementation to create and manage spans- Tracer
Provider Builder - Builder for provider attributes.
Enums§
- Sampler
- Default Sampling options
Traits§
- IdGenerator
- Interface for generating IDs
- Should
Sample - The
ShouldSampleinterface allows implementations to provide samplers which will return a samplingSamplingResultbased on information that is typically available just before theSpanwas created. - Span
Exporter SpanExporterdefines 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 SpanProcessoris an interface which allows hooks for span start and end method invocations. The span processors are invoked only when is_recording is true.
Functions§
- config
Deprecated - Default trace configuration