1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//! 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
//!
//! ```no_run
//! use opentelemetry_configuration::{OtelSdkBuilder, SdkError};
//!
//! fn main() -> Result<(), SdkError> {
//! let _guard = OtelSdkBuilder::new()
//! .service_name("my-service")
//! .build()?;
//!
//! tracing::info!("Application running");
//! Ok(())
//! }
//! ```
pub use ;
pub use ;
pub use SdkError;
pub use OtelGuard;
pub use ;
/// Re-exported for version compatibility with this crate's dependencies.
pub use opentelemetry;
/// Re-exported for version compatibility with this crate's dependencies.
pub use opentelemetry_sdk;
/// Re-exported for version compatibility with this crate's dependencies.
pub use tracing;
/// Re-exported for trace context propagation (e.g., `OpenTelemetrySpanExt::set_parent`).
pub use tracing_opentelemetry;
/// Re-exported for users who want to construct custom configuration providers.
pub use figment;
/// Captures Rust build-time information as resource attributes.
///
/// This macro reads environment variables set by [`emit_rustc_env`] in build.rs.
/// Use it with [`OtelSdkBuilder::with_rust_build_info`] to add rustc version
/// and channel information to your telemetry resource attributes.
///
/// # Example
///
/// In build.rs:
///
/// ```
/// opentelemetry_configuration::emit_rustc_env();
/// ```
///
/// In main.rs:
///
/// ```no_run
/// # fn main() -> Result<(), opentelemetry_configuration::SdkError> {
/// use opentelemetry_configuration::{OtelSdkBuilder, capture_rust_build_info};
///
/// let _guard = OtelSdkBuilder::new()
/// .service_name("my-service")
/// .with_rust_build_info(capture_rust_build_info!())
/// .build()?;
/// # Ok(())
/// # }
/// ```
///
/// # Attributes Added
///
/// When combined with [`emit_rustc_env`] in build.rs, this adds:
/// - `process.runtime.version` - rustc version (e.g., "1.84.0")
/// - `process.runtime.description` - full version string
/// - `rust.channel` - release channel ("stable", "beta", or "nightly")