Skip to content

Commit 57a1ee4

Browse files
committed
Fix telemetry resource export by adding rt-tokio feature
Without the rt-tokio feature on opentelemetry_sdk, the BatchSpanProcessor silently fails to export resource attributes (service.name, service.instance.id) with traces. This is a poorly designed API that compiles without errors but produces broken behavior at runtime. Changes: - Add rt-tokio feature to opentelemetry_sdk dependency - Re-enable AdaptiveSpanProcessor for tail-based sampling - Add comment explaining rt-tokio requirement - Bump version to 0.13.4 The issue only affected traces; logs and metrics were unaffected because they use different code paths (with_batch_exporter for logs works differently).
1 parent 1284152 commit 57a1ee4

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

Cargo.lock

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "openworkers-runner"
3-
version = "0.13.3"
3+
version = "0.13.4"
44
edition = "2024"
55
license = "MIT"
66
default-run = "openworkers-runner"
@@ -48,7 +48,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
4848
opentelemetry = { version = "0.31", optional = true }
4949
opentelemetry-otlp = { version = "0.31", features = ["grpc-tonic", "tls-roots"], optional = true }
5050
tonic = { version = "0.14", optional = true }
51-
opentelemetry_sdk = { version = "0.31", optional = true }
51+
opentelemetry_sdk = { version = "0.31", features = ["rt-tokio"], optional = true }
5252
tracing-opentelemetry = { version = "0.32", optional = true }
5353
opentelemetry-appender-tracing = { version = "0.31", features = ["experimental_use_tracing_span_context"], optional = true }
5454
sqlx = { version = "0.8.6", features = [ "runtime-tokio", "postgres", "uuid", "bigdecimal", "rust_decimal" ] }

src/telemetry.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ fn init_otel() -> Result<(), Box<dyn std::error::Error>> {
138138
);
139139

140140
// Create tracer provider
141+
// Note: Requires rt-tokio feature on opentelemetry_sdk for proper resource export
141142
let tracer_provider = SdkTracerProvider::builder()
142143
.with_resource(resource.clone())
143144
.with_span_processor(adaptive_processor)

0 commit comments

Comments
 (0)