fix(observability): prevent otel reactor panic in non-tokio contexts

This commit is contained in:
Chummy 2026-02-20 15:35:54 +08:00
parent 2d6205ee58
commit e7ccb573fa
3 changed files with 44 additions and 2 deletions

View file

@ -0,0 +1,17 @@
#[test]
fn opentelemetry_otlp_uses_blocking_reqwest_client() {
let manifest = include_str!("../Cargo.toml");
let otlp_line = manifest
.lines()
.find(|line| line.trim_start().starts_with("opentelemetry-otlp ="))
.expect("Cargo.toml must define opentelemetry-otlp dependency");
assert!(
otlp_line.contains("\"reqwest-blocking-client\""),
"opentelemetry-otlp must include reqwest-blocking-client to avoid Tokio reactor panics"
);
assert!(
!otlp_line.contains("\"reqwest-client\""),
"opentelemetry-otlp must not include async reqwest-client in this runtime mode"
);
}