forge
Explore
Log in

Don't you dare go Hollow

OTLP over HTTP exports from the SDK's own threads again

Browse files at this commit

1ab3b60374f0c2838508afed9c66d51f6a98d027Ahmet Kaan GümüşParent: 2ed10bf
  • fix
    • OTLP over HTTP exports from the SDK's own threads again
Show full message
🐛 fix: OTLP over HTTP exports from the SDK's own threads again

The `hyper-client` feature gave every OTLP exporter an HTTP client that
calls `tokio::time::timeout`, but the batch span/log processors and the
periodic metric reader each run on a plain `std::thread` with no reactor
on it. Every export attempt panicked with "there is no reactor running"
— the panic hook then logged it and the batch was dropped, so a
configured collector received nothing at all from any of the three
signals while the process looked healthy.

Swap the client to `reqwest-blocking-client`, which carries its own
runtime and is the client the sync processors expect. reqwest is pulled
with default features off (no extra TLS stack) and was already in the
lock file. Verified end to end against a live collector: spans
(`GET /health`, `GET unmatched`, `POST /builder/login`), the
`http.server.request.duration` histogram and the process's log records
all arrive, with no forbidden attribute keys among them.

Claude-Session: https://claude.ai/code/session_018sqvyBCZ9kpQP6vnGomT2s
Cargo.lockmodified+4 -4
@@ -2707,11 +2707,8 @@ dependencies = [
27072707 "async-trait",
27082708 "bytes",
27092709 "http",
2710- "http-body-util",
2711- "hyper",
2712- "hyper-util",
27132710 "opentelemetry",
2714- "tokio",
2711+ "reqwest",
27152712 ]
27162713
27172714 [[package]]
@@ -2726,6 +2723,7 @@ dependencies = [
27262723 "opentelemetry-proto",
27272724 "opentelemetry_sdk",
27282725 "prost",
2726+ "reqwest",
27292727 "thiserror",
27302728 "tokio",
27312729 "tonic",
@@ -3479,7 +3477,9 @@ dependencies = [
34793477 "bytes",
34803478 "cookie",
34813479 "cookie_store",
3480+ "futures-channel",
34823481 "futures-core",
3482+ "futures-util",
34833483 "http",
34843484 "http-body",
34853485 "http-body-util",
Cargo.tomlmodified+1 -1
@@ -51,7 +51,7 @@ tracing-opentelemetry = "0.33.0"
5151 opentelemetry-semantic-conventions = "0.32.1"
5252 uuid = { version = "1.26.0", features = ["v4"] }
5353 opentelemetry_sdk = { version = "0.32.1", features = ["rt-tokio"] }
54-opentelemetry-otlp = { version = "0.32.0", default-features = false, features = ["trace", "metrics", "logs", "grpc-tonic", "http-proto", "hyper-client", "internal-logs"] }
54+opentelemetry-otlp = { version = "0.32.0", default-features = false, features = ["trace", "metrics", "logs", "grpc-tonic", "http-proto", "reqwest-blocking-client", "internal-logs"] }
5555 opentelemetry-appender-tracing = "0.32.0"
5656
5757 [dev-dependencies]