Merge pull request 'otel: revert HTTP transport, keep gRPC' (#78) from fix/otlp-revert-to-grpc into master

Reviewed-on: #78
This commit was merged in pull request #78.
This commit is contained in:
2026-05-06 22:36:09 +00:00
3 changed files with 31 additions and 5 deletions

26
Cargo.lock generated
View File

@@ -1826,6 +1826,19 @@ dependencies = [
"tower-service", "tower-service",
] ]
[[package]]
name = "hyper-timeout"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0"
dependencies = [
"hyper",
"hyper-util",
"pin-project-lite",
"tokio",
"tower-service",
]
[[package]] [[package]]
name = "hyper-tls" name = "hyper-tls"
version = "0.6.0" version = "0.6.0"
@@ -2732,6 +2745,9 @@ dependencies = [
"prost", "prost",
"reqwest", "reqwest",
"thiserror 2.0.18", "thiserror 2.0.18",
"tokio",
"tonic",
"tracing",
] ]
[[package]] [[package]]
@@ -3377,6 +3393,7 @@ dependencies = [
"base64", "base64",
"bytes", "bytes",
"encoding_rs", "encoding_rs",
"futures-channel",
"futures-core", "futures-core",
"futures-util", "futures-util",
"h2 0.4.14", "h2 0.4.14",
@@ -4162,10 +4179,15 @@ dependencies = [
"http 1.4.0", "http 1.4.0",
"http-body", "http-body",
"http-body-util", "http-body-util",
"hyper",
"hyper-timeout",
"hyper-util",
"percent-encoding", "percent-encoding",
"pin-project", "pin-project",
"sync_wrapper", "sync_wrapper",
"tokio",
"tokio-stream", "tokio-stream",
"tower",
"tower-layer", "tower-layer",
"tower-service", "tower-service",
"tracing", "tracing",
@@ -4190,11 +4212,15 @@ checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4"
dependencies = [ dependencies = [
"futures-core", "futures-core",
"futures-util", "futures-util",
"indexmap",
"pin-project-lite", "pin-project-lite",
"slab",
"sync_wrapper", "sync_wrapper",
"tokio", "tokio",
"tokio-util",
"tower-layer", "tower-layer",
"tower-service", "tower-service",
"tracing",
] ]
[[package]] [[package]]

View File

@@ -44,9 +44,9 @@ prometheus = "0.13"
lazy_static = "1.5" lazy_static = "1.5"
anyhow = "1.0" anyhow = "1.0"
rand = "0.8.5" rand = "0.8.5"
opentelemetry = { version = "0.31.0", features = ["metrics", "trace"] } opentelemetry = { version = "0.31.0", features = ["default", "metrics", "tracing"] }
opentelemetry_sdk = { version = "0.31.0", features = ["rt-tokio-current-thread", "metrics", "logs"] } opentelemetry_sdk = { version = "0.31.0", features = ["default", "rt-tokio-current-thread", "metrics"] }
opentelemetry-otlp = { version = "0.31.0", default-features = false, features = ["trace", "metrics", "logs", "http-proto", "reqwest-client"] } opentelemetry-otlp = { version = "0.31.0", features = ["default", "metrics", "tracing", "grpc-tonic"] }
opentelemetry-stdout = "0.31.0" opentelemetry-stdout = "0.31.0"
opentelemetry-appender-log = "0.31.0" opentelemetry-appender-log = "0.31.0"
tempfile = "3.20.0" tempfile = "3.20.0"

View File

@@ -24,7 +24,7 @@ pub fn init_tracing() {
.build(); .build();
let span_exporter = opentelemetry_otlp::SpanExporter::builder() let span_exporter = opentelemetry_otlp::SpanExporter::builder()
.with_http() .with_tonic()
.with_endpoint(std::env::var("OTLP_OTLS_ENDPOINT").unwrap()) .with_endpoint(std::env::var("OTLP_OTLS_ENDPOINT").unwrap())
.build() .build()
.unwrap(); .unwrap();
@@ -40,7 +40,7 @@ pub fn init_tracing() {
#[allow(dead_code)] #[allow(dead_code)]
pub fn init_logs() { pub fn init_logs() {
let otlp_exporter = opentelemetry_otlp::LogExporter::builder() let otlp_exporter = opentelemetry_otlp::LogExporter::builder()
.with_http() .with_tonic()
.with_endpoint(std::env::var("OTLP_OTLS_ENDPOINT").unwrap()) .with_endpoint(std::env::var("OTLP_OTLS_ENDPOINT").unwrap())
.build() .build()
.unwrap(); .unwrap();