Skip to content

Commit ca4cded

Browse files
fix: include http client when otel enabled
1 parent 1891c4b commit ca4cded

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

crates/common/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exclude = ["protos/*/.github/*"]
1515

1616
[features]
1717
history_builders = ["rand"]
18-
otel = ["dep:opentelemetry", "dep:opentelemetry_sdk", "dep:opentelemetry-otlp"]
18+
otel = ["dep:opentelemetry", "dep:opentelemetry_sdk", "dep:opentelemetry-otlp", "dep:reqwest"]
1919
prometheus = [
2020
"dep:prometheus",
2121
"dep:hyper",
@@ -74,6 +74,7 @@ prost = { workspace = true }
7474
prost-wkt = "0.7"
7575
prost-types = { workspace = true }
7676
rand = { version = "0.10", optional = true }
77+
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls"], optional = true }
7778
ringbuf = { version = "0.4", optional = true }
7879
serde = { version = "1.0", features = ["derive"] }
7980
serde_json = { workspace = true }

crates/common/src/telemetry/otel.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ pub fn build_otlp_metric_exporter(
136136
}
137137
OtlpProtocol::Http => opentelemetry_otlp::MetricExporter::builder()
138138
.with_http()
139+
.with_http_client(reqwest::Client::new())
139140
.with_endpoint(opts.url.to_string())
140141
.with_headers(opts.headers)
141142
.with_temporality(metric_temporality_to_temporality(opts.metric_temporality))

0 commit comments

Comments
 (0)