opentelemetry-rust
opentelemetry-rust copied to clipboard
[Bug]: unclear how to setup http(hyper) without agent pipeline
What happened?
opentelemetry = "0.22"
opentelemetry_sdk = { version = "0.22", features = ["rt-tokio"] }
tracing-opentelemetry = "0.23"
opentelemetry-jaeger-propagator = "0.1.0"
opentelemetry-jaeger = { version = "0.21", features = ["collector_client", "hyper_collector_client", "rt-tokio"] }
opentelemetry-otlp = { version = "0.15.0", features = ["http-proto"] }
these are the enabled features
global::set_text_map_propagator(opentelemetry_jaeger_propagator::Propagator::new());
let otlp_exporter = opentelemetry_otlp::new_exporter()
.http()
.with_endpoint(jager_endpoint);
let tracer =
opentelemetry_otlp::new_pipeline()
.tracing()
.with_exporter(otlp_exporter)
.with_trace_config(trace::config().with_resource(Resource::new(vec![
KeyValue::new("service.name", "clash-rs"),
])))
.install_batch(opentelemetry_sdk::runtime::Tokio)?;
these are the setup
problem is
failed to setup logging: Exporter otlp encountered the following error(s): no http client, you must select one from features or provide your own implementation
how do i active the default hyper client?
ty
API Version
x
SDK Version
x
What Exporters are you seeing the problem on?
No response
Relevant log output
No response
https://github.com/open-telemetry/opentelemetry-rust/blob/main/opentelemetry-otlp/examples/basic-otlp-http/src/main.rs and https://github.com/open-telemetry/opentelemetry-rust/blob/main/opentelemetry-otlp/examples/basic-otlp-http/Cargo.toml#L12 Can you check this example, and see if it helps?
This is not resolved, as shown here : https://github.com/open-telemetry/opentelemetry-rust/pull/1756#issuecomment-2109176774
125 | Some(tracing_opentelemetry::layer().with_tracer(tracer))
| ----------- ^^^^^^ the trait `PreSampledTracer` is not implemented for `opentelemetry_sdk::trace::Tracer`
| |
| required by a bound introduced by this call
|
how to have PreSampledTracer
implemented for a tracer below?
let tracer = opentelemetry_otlp::new_pipeline()
.tracing()
.with_exporter(otlp_exporter)
.with_trace_config(
trace::config()
.with_sampler(Sampler::AlwaysOn)
.with_resource(Resource::new(vec![KeyValue::new(
"service.name",
"clash-rs",
)])),
)
.install_batch(opentelemetry_sdk::runtime::Tokio)?;
I'm getting new API compatibility issue..
Hi @ibigbug - if you are still interested here could you check that the example in https://github.com/open-telemetry/opentelemetry-rust/pull/1861/files would help?
Hey thanks for getting back. I've moved to grpc setup but will give this a try hopefully