You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use opentelemetry::exporter::trace::stdout;
use tracing::{error, span};
use tracing_subscriber::subscriber::SubscriberExt;
use tracing_subscriber::Registry;
fn main() {
// Install a new OpenTelemetry trace pipeline
let (tracer, _uninstall) = stdout::new_pipeline().install();
// Create a tracing subscriber with the configured tracer
let telemetry = tracing_opentelemetry::subscriber().with_tracer(tracer);
// Use the tracing subscriber `Registry`, or any other subscriber
// that impls `LookupSpan`
let collector = Registry::default().with(telemetry);
// Trace executed code
tracing::collect::with_default(collector, || {
// Spans will be sent to the configured OpenTelemetry exporter
let root = span!(tracing::Level::TRACE, "app_start", work_units = 2);
let _enter = root.enter();
error!("This event will be logged in the root span.");
});
}
I expected to see this happen: the code should compile
Instead, this happened:
error[E0277]: the trait bound `opentelemetry::sdk::trace::Tracer: opentelemetry::trace::tracer::Tracer` is not satisfied
--> src/main.rs:11:64
|
11 | let telemetry = tracing_opentelemetry::layer().with_tracer(tracer);
| ----------- ^^^^^^ the trait `opentelemetry::trace::tracer::Tracer` is not implemented for `opentelemetry::sdk::trace::Tracer`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `opentelemetry::trace::tracer::Tracer`:
opentelemetry::global::trace::BoxedTracer
opentelemetry::sdk::trace::tracer::Tracer
opentelemetry::trace::noop::NoopTracer
note: required by a bound in `OpenTelemetryLayer::<S, T>::with_tracer`
--> /home/eng/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/tracing-opentelemetry-0.17.4/src/layer.rs:464:17
|
464 | Tracer: otel::Tracer + PreSampledTracer + 'static,
| ^^^^^^^^^^^^ required by this bound in `OpenTelemetryLayer::<S, T>::with_tracer`
The text was updated successfully, but these errors were encountered:
Bug Report
Version
Platform
Crates
tracing-opentelemetry v0.17.4
Description
tracing-opentelemetry
v0.17.4 doesn't work with latestopentelemetry
v0.18.0I tried this example code:
I expected to see this happen: the code should compile
Instead, this happened:
The text was updated successfully, but these errors were encountered: