From a1757fcc7358cec2c270eb0dc792a13964313464 Mon Sep 17 00:00:00 2001 From: Mark S Date: Fri, 10 Jan 2025 14:43:50 -0500 Subject: [PATCH] feat: export SDK crate version as constant --- opentelemetry-sdk/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) 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");