Skip to content

Commit 5c6ad04

Browse files
authored
Merge branch 'main' into main
2 parents b140f49 + df412fe commit 5c6ad04

File tree

11 files changed

+59
-61
lines changed

11 files changed

+59
-61
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
with:
6666
toolchain: stable
6767
components: rustfmt, clippy
68-
- uses: taiki-e/install-action@47be02f2de8a32619316956f6117e150bdc6763f # v2.62.44
68+
- uses: taiki-e/install-action@6f9c7cc51aa54b13cbcbd12f8bbf69d8ba405b4b # v2.62.47
6969
with:
7070
tool: cargo-hack
7171
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
@@ -93,7 +93,7 @@ jobs:
9393
# https://github.com/awslabs/cargo-check-external-types/releases
9494
toolchain: nightly-2025-05-04
9595
components: rustfmt
96-
- uses: taiki-e/install-action@47be02f2de8a32619316956f6117e150bdc6763f # v2.62.44
96+
- uses: taiki-e/install-action@6f9c7cc51aa54b13cbcbd12f8bbf69d8ba405b4b # v2.62.47
9797
with:
9898
9999
- name: external-type-check
@@ -117,7 +117,7 @@ jobs:
117117
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
118118
with:
119119
toolchain: stable
120-
- uses: taiki-e/install-action@47be02f2de8a32619316956f6117e150bdc6763f # v2.62.44
120+
- uses: taiki-e/install-action@6f9c7cc51aa54b13cbcbd12f8bbf69d8ba405b4b # v2.62.47
121121
with:
122122
tool: cargo-msrv
123123
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
@@ -150,7 +150,7 @@ jobs:
150150
uses: EmbarkStudios/cargo-deny-action@f2ba7abc2abebaf185c833c3961145a3c275caad # v2.0.13
151151
with:
152152
command: check bans
153-
153+
154154
- name: Check sources
155155
uses: EmbarkStudios/cargo-deny-action@f2ba7abc2abebaf185c833c3961145a3c275caad # v2.0.13
156156
with:
@@ -199,7 +199,7 @@ jobs:
199199
with:
200200
repo-token: ${{ secrets.GITHUB_TOKEN }}
201201
- name: Install cargo-llvm-cov
202-
uses: taiki-e/install-action@47be02f2de8a32619316956f6117e150bdc6763f # v2.62.44
202+
uses: taiki-e/install-action@6f9c7cc51aa54b13cbcbd12f8bbf69d8ba405b4b # v2.62.47
203203
with:
204204
tool: cargo-llvm-cov
205205
- name: cargo generate-lockfile
@@ -232,7 +232,7 @@ jobs:
232232
cargo build
233233
fi
234234
done
235-
cargo-machete:
235+
cargo-shear:
236236
continue-on-error: true
237237
runs-on: ubuntu-latest
238238
steps:
@@ -246,9 +246,12 @@ jobs:
246246
submodules: true
247247
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
248248
with:
249-
toolchain: stable
250-
- uses: taiki-e/install-action@47be02f2de8a32619316956f6117e150bdc6763f # v2.62.44
249+
toolchain: nightly
250+
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
251+
with:
252+
repo-token: ${{ secrets.GITHUB_TOKEN }}
253+
- uses: taiki-e/install-action@6f9c7cc51aa54b13cbcbd12f8bbf69d8ba405b4b # v2.62.47
251254
with:
252-
tool: cargo-machete
253-
- name: cargo machete
254-
run: cargo machete
255+
tool: cargo-shear
256+
- name: cargo shear
257+
run: cargo shear --expand

Cargo.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ log = "0.4.21"
3333
once_cell = "1.13"
3434
pin-project-lite = "0.2"
3535
prost = "0.14"
36-
prost-build = "0.14"
37-
prost-types = "0.14"
3836
rand = { version = "0.9", default-features = false }
3937
reqwest = { version = "0.12", default-features = false }
4038
serde = { version = "1.0", default-features = false }
@@ -100,3 +98,10 @@ tail_expr_drop_order = "allow"
10098

10199
[workspace.lints.clippy]
102100
all = { level = "warn", priority = 1 }
101+
102+
[workspace.metadata.cargo-shear]
103+
ignored = [
104+
# workspace crates
105+
"opentelemetry-appender-log",
106+
"opentelemetry-jaeger-propagator",
107+
]

examples/tracing-grpc/Cargo.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,3 @@ tonic-prost = { workspace = true }
2828

2929
[build-dependencies]
3030
tonic-prost-build = { workspace = true }
31-
32-
[package.metadata.cargo-machete]
33-
ignored = [
34-
"prost", # needed for `tonic-prost-build`
35-
"tonic-prost" # needed for `tonic-prost-build`
36-
]

opentelemetry-otlp/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Released 2025-Sep-25
1212
- Update `opentelemetry-proto` and `opentelemetry-http` dependency version to 0.31.0
1313
- Add HTTP compression support with `gzip-http` and `zstd-http` feature flags
1414
- Add retry with exponential backoff and throttling support for HTTP and gRPC exporters
15+
This behaviour is opt in via the `experimental-grpc-retry` and `experimental-http-retry` flags on this crate. You can customize the retry policy using the `with_retry_policy` on the exporter builders.
1516

1617
## 0.30.0
1718

opentelemetry-otlp/src/retry.rs

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
//! specified retry policy, using exponential backoff and jitter to determine the delay between
88
//! retries. The function uses error classification to determine retry behavior and can honor
99
//! server-provided throttling hints.
10+
#[cfg(any(
11+
feature = "experimental-grpc-retry",
12+
feature = "experimental-http-retry"
13+
))]
14+
use opentelemetry::{otel_debug, otel_info};
1015

1116
#[cfg(any(
1217
feature = "experimental-grpc-retry",
@@ -17,24 +22,23 @@ use opentelemetry::otel_warn;
1722
feature = "experimental-grpc-retry",
1823
feature = "experimental-http-retry"
1924
))]
20-
use std::future::Future;
25+
use opentelemetry_sdk::runtime::Runtime;
2126
#[cfg(any(
2227
feature = "experimental-grpc-retry",
2328
feature = "experimental-http-retry"
2429
))]
25-
use std::hash::{DefaultHasher, Hasher};
26-
use std::time::Duration;
30+
use std::future::Future;
2731
#[cfg(any(
2832
feature = "experimental-grpc-retry",
2933
feature = "experimental-http-retry"
3034
))]
31-
use std::time::SystemTime;
32-
35+
use std::hash::{DefaultHasher, Hasher};
36+
use std::time::Duration;
3337
#[cfg(any(
3438
feature = "experimental-grpc-retry",
3539
feature = "experimental-http-retry"
3640
))]
37-
use opentelemetry_sdk::runtime::Runtime;
41+
use std::time::SystemTime;
3842

3943
/// Classification of errors for retry purposes.
4044
#[derive(Debug, Clone, PartialEq)]
@@ -61,26 +65,6 @@ pub struct RetryPolicy {
6165
pub jitter_ms: u64,
6266
}
6367

64-
/// A runtime stub for when experimental_async_runtime is not enabled.
65-
/// This allows retry policy to be configured but no actual retries occur.
66-
#[cfg(not(any(
67-
feature = "experimental-grpc-retry",
68-
feature = "experimental-http-retry"
69-
)))]
70-
#[derive(Debug, Clone, Default)]
71-
pub struct NoOpRuntime;
72-
73-
#[cfg(not(any(
74-
feature = "experimental-grpc-retry",
75-
feature = "experimental-http-retry"
76-
)))]
77-
impl NoOpRuntime {
78-
/// Creates a new no-op runtime.
79-
pub fn new() -> Self {
80-
Self
81-
}
82-
}
83-
8468
// Generates a random jitter value up to max_jitter
8569
#[cfg(any(
8670
feature = "experimental-grpc-retry",
@@ -144,15 +128,23 @@ where
144128

145129
match error_type {
146130
RetryErrorType::NonRetryable => {
147-
otel_warn!(name: "OtlpRetry", message = format!("Operation {:?} failed with non-retryable error: {:?}", operation_name, err));
131+
otel_warn!(name: "Export.Failed.NonRetryable",
132+
operation = operation_name,
133+
message = "OTLP export failed with non-retryable error - telemetry data will be lost");
148134
return Err(err);
149135
}
150136
RetryErrorType::Retryable if attempt < policy.max_retries => {
151137
attempt += 1;
152138
// Use exponential backoff with jitter
153-
otel_warn!(name: "OtlpRetry", message = format!("Retrying operation {:?} due to retryable error: {:?}", operation_name, err));
154139
let jitter = generate_jitter(policy.jitter_ms);
155140
let delay_with_jitter = std::cmp::min(delay + jitter, policy.max_delay_ms);
141+
otel_debug!(name: "Export.InProgress.Retrying",
142+
operation = operation_name,
143+
attempt = attempt,
144+
delay_ms = delay_with_jitter,
145+
jitter_ms = jitter,
146+
message = "OTLP export failed with retryable error - retrying"
147+
);
156148
runtime
157149
.delay(Duration::from_millis(delay_with_jitter))
158150
.await;
@@ -161,13 +153,22 @@ where
161153
RetryErrorType::Throttled(server_delay) if attempt < policy.max_retries => {
162154
attempt += 1;
163155
// Use server-specified delay (overrides exponential backoff)
164-
otel_warn!(name: "OtlpRetry", message = format!("Retrying operation {:?} after server-specified throttling delay: {:?}", operation_name, server_delay));
156+
otel_info!(name: "Export.InProgress.Throttled",
157+
operation = operation_name,
158+
attempt = attempt,
159+
delay_ms = server_delay.as_millis(),
160+
message = "OTLP export throttled by OTLP endpoint - delaying and retrying"
161+
);
165162
runtime.delay(server_delay).await;
166163
// Don't update exponential backoff delay for next attempt since server provided specific timing
167164
}
168165
_ => {
169166
// Max retries reached
170-
otel_warn!(name: "OtlpRetry", message = format!("Operation {:?} failed after {} attempts: {:?}", operation_name, attempt, err));
167+
otel_warn!(name: "Export.Failed.Exhausted",
168+
operation = operation_name,
169+
retries = attempt,
170+
message = "OTLP export exhausted retries - telemetry data will be lost"
171+
);
171172
return Err(err);
172173
}
173174
}

opentelemetry-otlp/tests/integration_test/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ tracing = {workspace = true}
2323
[target.'cfg(unix)'.dependencies]
2424
opentelemetry-appender-tracing = { path = "../../../opentelemetry-appender-tracing", default-features = false}
2525
opentelemetry-otlp = { path = "../../../opentelemetry-otlp", default-features = false }
26-
opentelemetry-semantic-conventions = { path = "../../../opentelemetry-semantic-conventions" }
2726

2827
[features]
2928
hyper-client = ["opentelemetry-otlp/hyper-client", "opentelemetry-otlp/http-proto", "opentelemetry-otlp/trace", "opentelemetry-otlp/logs", "opentelemetry-otlp/metrics", "internal-logs"]

opentelemetry-prometheus/Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,3 @@ tokio = { version = "1", features = ["full"] }
3737
default = ["internal-logs"]
3838
prometheus-encoding = []
3939
internal-logs = ["tracing"]
40-
41-
[package.metadata.cargo-machete]
42-
ignored = [
43-
"tracing" # needed for `internal-logs`
44-
]

opentelemetry-proto/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ base64 = { workspace = true, optional = true }
6666
[dev-dependencies]
6767
opentelemetry = { workspace = true, features = ["testing"] }
6868
tonic-prost-build = { workspace = true }
69-
prost-build = { workspace = true }
7069
tempfile = { workspace = true }
7170
serde_json = { workspace = true }
7271

opentelemetry/CHANGELOG.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- **Breaking** Removed the following public fields and methods from the `SpanBuilder` [#3227][3227]:
77
- `trace_id`, `span_id`, `end_time`, `status`, `sampling_result`
88
- `with_trace_id`, `with_span_id`, `with_end_time`, `with_status`, `with_sampling_result`
9+
- **Added** `#[must_use]` attribute to `opentelemetry::metrics::AsyncInstrumentBuilder` to add compile time warning when `.build()` is not called on observable instrument builders, preventing silent failures where callbacks are never registered and metrics are never reported.
910

1011
[3227]: https://github.com/open-telemetry/opentelemetry-rust/pull/3227
1112

@@ -117,10 +118,10 @@ let counter = meter.u64_counter("my_counter").build();
117118
- Replaced `global::meter_with_version` with `global::meter_with_scope`
118119
- Added `global::tracer_with_scope`
119120
- Refer to PR description for migration guide.
120-
- **Breaking change**: replaced `InstrumentationScope` public attributes by getters [#2275](https://github.com/open-telemetry/opentelemetry-rust/pull/2275)
121+
- **Breaking change**: replaced `InstrumentationScope` public attributes by getters [#2275](https://github.com/open-telemetry/opentelemetry-rust/pull/2275)
121122

122123
- **Breaking change**: [#2260](https://github.com/open-telemetry/opentelemetry-rust/pull/2260)
123-
- Removed `global::set_error_handler` and `global::handle_error`.
124+
- Removed `global::set_error_handler` and `global::handle_error`.
124125
- `global::handle_error` usage inside the opentelemetry crates has been replaced with `global::otel_info`, `otel_warn`, `otel_debug` and `otel_error` macros based on the severity of the internal logs.
125126
- The default behavior of `global::handle_error` was to log the error using `eprintln!`. With otel macros, the internal logs get emitted via `tracing` macros of matching severity. Users now need to configure a `tracing` layer/subscriber to capture these logs.
126127
- Refer to PR description for migration guide. Also refer to [self-diagnostics](https://github.com/open-telemetry/opentelemetry-rust/tree/main/examples/self-diagnostics) example to learn how to view internal logs in stdout using `tracing::fmt` layer.
@@ -220,7 +221,7 @@ to learn how to provide Observable callbacks.
220221
opaque string. Migration: Replace `.with_unit(Unit::new("myunit"))` with
221222
`.with_unit("myunit")`.
222223

223-
- [1869](https://github.com/open-telemetry/opentelemetry-rust/pull/1869) Introduced the `LogRecord::set_target()` method in the log bridge API.
224+
- [1869](https://github.com/open-telemetry/opentelemetry-rust/pull/1869) Introduced the `LogRecord::set_target()` method in the log bridge API.
224225
This method allows appenders to set the target/component emitting the logs.
225226

226227
## v0.23.0
@@ -241,7 +242,7 @@ This method allows appenders to set the target/component emitting the logs.
241242
- opentelemetry::global::shutdown_logger_provider
242243
- opentelemetry::global::logger_provider
243244
- opentelemetry::global::GlobalLoggerProvider
244-
- opentelemetry::global::ObjectSafeLoggerProvider
245+
- opentelemetry::global::ObjectSafeLoggerProvider
245246
For creating appenders using Logging bridge API, refer to the opentelemetry-tracing-appender [example](https://github.com/open-telemetry/opentelemetry-rust/blob/main/opentelemetry-appender-tracing/examples/basic.rs)
246247

247248
### Changed

opentelemetry/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ opentelemetry_sdk = { path = "../opentelemetry-sdk", features = ["spec_unstable_
4646
criterion = { workspace = true }
4747
rand = { workspace = true, features = ["os_rng", "thread_rng"] }
4848
tokio = { version = "1.0", features = ["full"] }
49-
futures = "0.3"
5049

5150
[[bench]]
5251
name = "metrics"

0 commit comments

Comments
 (0)