diff --git a/opentelemetry-sdk/src/lib.rs b/opentelemetry-sdk/src/lib.rs index 4afda7deb7..aab400517a 100644 --- a/opentelemetry-sdk/src/lib.rs +++ b/opentelemetry-sdk/src/lib.rs @@ -150,3 +150,7 @@ pub mod util; pub use resource::Resource; pub mod error; + +/// The crate's version string, useful for populating [`Resource`] keys like +/// [`telemetry.sdk.version`](https://docs.rs/opentelemetry-semantic-conventions/latest/opentelemetry_semantic_conventions/attribute/constant.TELEMETRY_SDK_VERSION.html) +pub const VERSION: &str = env!("CARGO_PKG_VERSION");