Crate opentelemetry_configuration

Crate opentelemetry_configuration 

Source
Expand description

Opinionated OpenTelemetry SDK configuration and lifecycle management.

Wires together the OpenTelemetry SDK, OTLP exporters, and tracing into a cohesive configuration system with automatic lifecycle management.

§Example

use opentelemetry_configuration::{OtelSdkBuilder, SdkError};

fn main() -> Result<(), SdkError> {
    let _guard = OtelSdkBuilder::new()
        .service_name("my-service")
        .build()?;

    tracing::info!("Application running");
    Ok(())
}

Re-exports§

pub use opentelemetry;
pub use opentelemetry_sdk;
pub use tracing;
pub use tracing_opentelemetry;
pub use figment;

Macros§

capture_rust_build_info
Captures Rust build-time information as resource attributes.

Structs§

BatchConfig
Batch exporter configuration.
EndpointConfig
Endpoint configuration.
OtelGuard
Guard that manages OpenTelemetry provider lifecycle.
OtelSdkBuilder
Builder for configuring and initialising the OpenTelemetry SDK.
OtelSdkConfig
Complete OpenTelemetry SDK configuration.
ResourceConfig
Resource configuration.
ResourceConfigBuilder
Builder for resource configuration.
RustBuildInfo
Rust build-time information captured via build.rs.
RustResourceDetector
Detects Rust runtime resource attributes.
SignalConfig
Configuration for an individual signal type (traces, metrics, logs).

Enums§

ComputeEnvironment
Compute environment for resource attribute detection.
Protocol
OTLP export protocol.
SdkError
Errors from SDK initialisation and lifecycle.

Functions§

emit_rustc_env
Emits rustc version information as cargo environment variables.