From 502d883efe8804ae85ccd8ead210a209e65ead0f Mon Sep 17 00:00:00 2001 From: Cristiano Piemontese Date: Tue, 28 Nov 2023 09:54:31 +0100 Subject: [PATCH 1/4] update dependencies together --- Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 11f9cea..f8cec48 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,11 +37,11 @@ required-features = ["json-logger"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -opentelemetry = {version = "0.20", features = ["rt-tokio"], optional = true} -opentelemetry-otlp = {version = "0.13", features = ["http-proto", "reqwest-client"], default-features = false, optional = true} +opentelemetry = {version = "0.21", features = ["rt-tokio"], optional = true} +opentelemetry-otlp = {version = "0.14", features = ["http-proto", "reqwest-client"], default-features = false, optional = true} tracing = {version = "0.1", features = ["max_level_debug", "release_max_level_info"]} tracing-log = {version = "0.2"} -tracing-opentelemetry = {version = "0.21", optional = true} +tracing-opentelemetry = {version = "0.22", optional = true} tracing-subscriber = {version = "0.3", features = ["env-filter"]} # serialization/deserialization From ce906a1fb074eb3a917de70777a4eb9b07b89819 Mon Sep 17 00:00:00 2001 From: Cristiano Piemontese Date: Tue, 28 Nov 2023 10:22:07 +0100 Subject: [PATCH 2/4] move sdk stuff to opentelemetry_sdk --- Cargo.toml | 5 +++-- src/subscriber.rs | 3 ++- src/telemetry.rs | 16 +++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f8cec48..e806163 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ traces = ["tracing-opentelemetry", "opentelemetry", "opentelemetry-otlp"] dev = ["traces"] live = ["json-logger", "datadog", "traces"] -rt-tokio-current-thread = ["opentelemetry/rt-tokio-current-thread"] +rt-tokio-current-thread = ["opentelemetry_sdk/rt-tokio-current-thread"] [[example]] name = "custom-json-subscriber" @@ -37,8 +37,9 @@ required-features = ["json-logger"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -opentelemetry = {version = "0.21", features = ["rt-tokio"], optional = true} +opentelemetry = {version = "0.21", optional = true} opentelemetry-otlp = {version = "0.14", features = ["http-proto", "reqwest-client"], default-features = false, optional = true} +opentelemetry_sdk = {version = "0.21", features = ["rt-tokio"], optional = true} tracing = {version = "0.1", features = ["max_level_debug", "release_max_level_info"]} tracing-log = {version = "0.2"} tracing-opentelemetry = {version = "0.22", optional = true} diff --git a/src/subscriber.rs b/src/subscriber.rs index 5a7721f..c0f2902 100644 --- a/src/subscriber.rs +++ b/src/subscriber.rs @@ -58,7 +58,8 @@ pub fn init_subscriber(subscriber: impl Subscriber + Sync + Send) -> Uninstall { #[cfg(feature = "traces")] { - use opentelemetry::{global, sdk::propagation::TraceContextPropagator}; + use opentelemetry::global; + use opentelemetry_sdk::propagation::TraceContextPropagator; global::set_text_map_propagator(TraceContextPropagator::new()); }; Uninstall diff --git a/src/telemetry.rs b/src/telemetry.rs index dd76e6f..02b1dd7 100644 --- a/src/telemetry.rs +++ b/src/telemetry.rs @@ -1,11 +1,9 @@ -use opentelemetry::{ - sdk::{ - trace::{self, Tracer}, - Resource, - }, - KeyValue, -}; +use opentelemetry::KeyValue; use opentelemetry_otlp::WithExportConfig; +use opentelemetry_sdk::{ + trace::{self, Tracer}, + Resource, +}; use tracing::{span, Subscriber}; use tracing_opentelemetry::OtelData; use tracing_subscriber::{layer::Context, Layer}; @@ -21,11 +19,11 @@ pub fn configure(config: &SubscriberConfig) -> Tracer { let runtime = { #[cfg(feature = "rt-tokio-current-thread")] { - opentelemetry::runtime::TokioCurrentThread + opentelemetry_sdk::runtime::TokioCurrentThread } #[cfg(not(feature = "rt-tokio-current-thread"))] { - opentelemetry::runtime::Tokio + opentelemetry_sdk::runtime::Tokio } }; From 739474cce5043ebef75fea4a7f64ce94f6758a29 Mon Sep 17 00:00:00 2001 From: Cristiano Piemontese Date: Tue, 28 Nov 2023 10:29:24 +0100 Subject: [PATCH 3/4] update changelog --- CHANGELOG.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e86fed..38f19ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- New `opentelemetry_sdk` dependency, which inherits the `rt-tokio` feature + +### Changed + +- Bump `opentelemetry` to 0.21 and remove the `rt-tokio` feature +- Bump `opentelemetry-otlp` to 0.14 +- Bump `tracing-opentelemetry` to 0.22 +- Move `rt-tokio-current-thread` to map to `["opentelemetry_sdk/rt-tokio-current-thread"]`, the tokio stuff has been moved to `opentelemetry_sdk` + --- ## [0.7.2] - 2023-10-26 +### Changed + - Bump `tracing-log` to 0.2 --- @@ -102,7 +115,6 @@ If you are using Jaeger to collect traces locally on your machine, you will need COLLECTOR_OTLP_HTTP_HOST_PORT: 55681 ``` - [Unreleased]: https://github.com/primait/prima_tracing.rs/compare/0.7.2...HEAD [0.7.2]: https://github.com/primait/prima_tracing.rs/compare/0.7.1...0.7.2 [0.7.1]: https://github.com/primait/prima_tracing.rs/compare/0.7.0...0.7.1 From 2f341f01d721a3bdf1ea605bd345710c48d4781f Mon Sep 17 00:00:00 2001 From: Cristiano Piemontese Date: Thu, 30 Nov 2023 11:47:40 +0100 Subject: [PATCH 4/4] bump dev deps otel --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index e806163..e2e2c08 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,4 +57,4 @@ chrono = {version = "^0.4", default-features = false, features = ["serde", "cloc actix-web = "4.0.1" prima_bridge = "0.15" tokio = {version = "1.17", features = ["rt", "macros", "rt-multi-thread"]} -tracing-actix-web = {version = "0.7.0", features = ["opentelemetry_0_20"]} +tracing-actix-web = {version = "0.7.0", features = ["opentelemetry_0_21"]}