Skip to content

Commit 92c0364

Browse files
authored
Upgrade OpenTelemetry to 0.31 (#108)
1 parent e271d83 commit 92c0364

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

CHANGELOG.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
- Upgrade `opentelemetry` dependencies to `v0.31`.
11+
1012
## [0.43.0] - 2025-09-01
1113

1214
- In live metrics, report CPU and memory usage of the current process rather than the system. This is more useful, especially when more than one application is running on the system. This also follows what the .NET SDK does. Thanks, [rafamerlin@](https://github.com/rafamerlin).
@@ -27,13 +29,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2729
- **Breaking**: Remove pipeline API. This requires some consumer changes:
2830

2931
In short:
30-
3132
- Create exporter using `opentelemetry_application_insights::Exporter::new_from_connection_string`.
3233
- Configure Application Insights specifics using `.with_` functions on the exporter.
3334
- Create and configure trace, metrics, and logs providers using `opentelemetry_sdk::trace::SdkTracerProvider`, `opentelemetry_sdk::metrics::SdkMeterProvider`, and `opentelemetry_sdk::logs::SdkLoggerProvider`.
3435

3536
In detail, here are replacements for functions on the removed pipeline API:
36-
3737
- `new_pipeline_from_env` --> `Exporter::new_from_env`
3838
- `new_pipeline_from_connection_string` --> `Exporter::new_from_connection_string`
3939
- `pipeline_builder.with_sample_rate` --> `exporter.with_sample_rate`
@@ -51,11 +51,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
5151
## [0.38.0] - 2025-02-22
5252

5353
- Upgrade `opentelemetry` dependencies to `v0.28`.
54-
5554
- The `trace` feature turns on `opentelemetry_sdk/experimental_trace_batch_span_processor_with_async_runtime` in this release to avoid breaking API changes and to make this release simpler for me. In the future I hope to align the API with other crates like `opentelemetry-otlp`, which means removing the pipeline API. Examples have already been updated to the new API.
5655

5756
- If you're using `logs` or `metrics` make sure you use matching combinations of sync/async HTTP clients and runtimes. E.g.:
58-
5957
- Use `reqwest::blocking::Client` with `.with_batch_exporter(exporter)`. If you're already in an async context, you might need to create the client using `std::thread::spawn(reqwest::blocking::Client::new).join().unwrap()`.
6058
- Use `reqwest::Client` with `.with_log_processor(opentelemetry_sdk::logs::log_processor_with_async_runtime::BatchLogProcessor::builder(exporter, opentelemetry_sdk::runtime::Tokio).build())`.
6159

@@ -101,7 +99,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
10199
## [0.31.0] - 2024-05-09
102100

103101
- Change how the tags Could role, Cloud role instance, Application version and Internal SDK version are extracted:
104-
105102
- Spans no longer extract them from span attributes. They still extract them from resource attributes. And they newly extract them also from instrumentation library attributes.
106103
- Events newly extract them from resource and instrumentation library attributes.
107104

@@ -204,7 +201,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
204201
- Upgrade to `v0.13.0` of `opentelemetry`.
205202

206203
The choice of simple/batch span processor as well as the async runtime now needs to be made in Rust code:
207-
208204
- If you previously used `.install()` with the `reqwest::blocking::Client`, you should now use `.install_simple()`.
209205
- If you previously used `.install()` with the `reqwest::Client` and the Tokio runtime, you should now use `.install_batch(opentelemetry::runtime::Tokio)` as well as enable to **opentelemetry/rt-tokio** feature.
210206
- If you previously used `.install()` with the `surf::Client` and the async-std runtime, you should now use `.install_batch(opentelemetry::runtime::AsyncStd)` as well as enable to **opentelemetry/rt-async-std** feature.

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ flate2 = "1"
5454
futures-util = { version = "0.3", default-features = false, optional = true }
5555
http = "1"
5656
once_cell = "1"
57-
opentelemetry = "0.30"
58-
opentelemetry-http = "0.30"
59-
opentelemetry-semantic-conventions = { version = "0.30", features = ["semconv_experimental"] }
60-
opentelemetry_sdk = "0.30"
57+
opentelemetry = "0.31"
58+
opentelemetry-http = "0.31"
59+
opentelemetry-semantic-conventions = { version = "0.31", features = ["semconv_experimental"] }
60+
opentelemetry_sdk = "0.31"
6161
reqwest = { version = "0.12", default-features = false, features = ["blocking"], optional = true }
6262
serde = { version = "1", features = ["derive"] }
6363
serde_json = "1"
@@ -71,9 +71,9 @@ doc-comment = "0.3.3"
7171
env_logger = "0.11.3"
7272
insta = "1.39.0"
7373
log = { version = "0.4", features = ["kv", "kv_sval"] }
74-
opentelemetry_sdk = { version = "0.30", features = ["rt-tokio", "rt-tokio-current-thread", "spec_unstable_logs_enabled", "experimental_trace_batch_span_processor_with_async_runtime"] }
75-
opentelemetry-http = { version = "0.30", features = ["reqwest"] }
76-
opentelemetry-appender-log = { version = "0.30", features = ["with-serde"] }
74+
opentelemetry_sdk = { version = "0.31", features = ["rt-tokio", "rt-tokio-current-thread", "spec_unstable_logs_enabled", "experimental_trace_batch_span_processor_with_async_runtime"] }
75+
opentelemetry-http = { version = "0.31", features = ["reqwest", "reqwest-blocking"] }
76+
opentelemetry-appender-log = { version = "0.31", features = ["with-serde"] }
7777
rand = "0.9"
7878
regex = "1.10.5"
7979
reqwest = { version = "0.12", features = ["blocking"] }

0 commit comments

Comments
 (0)