Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should we update to opentelemetry 0.23? #140

Closed
frederikhors opened this issue May 22, 2024 · 3 comments
Closed

Should we update to opentelemetry 0.23? #140

frederikhors opened this issue May 22, 2024 · 3 comments

Comments

@frederikhors
Copy link

frederikhors commented May 22, 2024

With these deps:

opentelemetry = { version = "0.22.0", default-features = false, features = [
    "trace",
] }
opentelemetry-http = { version = "0.11.1", default-features = false }
opentelemetry-otlp = { version = "0.15.0", default-features = false, features = [
    "http-proto",
] }
opentelemetry_sdk = { version = "0.22", default-features = false, features = [
    "rt-tokio",
] }

I'm using:

let otlp_tracer = opentelemetry_otlp::new_pipeline()
    .tracing()
    .with_exporter(exporter)
    .with_trace_config(trace::config().with_resource(Resource::new(vec![
        KeyValue::new("service.name", service_name.to_string()),
    ])))
    .with_batch_config(
        trace::BatchConfigBuilder::default()
            .with_max_export_batch_size(10_000)
            .with_max_queue_size(30_000)
            .with_scheduled_delay(Duration::from_millis(5_000))
            .build(),
    )
    .install_batch(opentelemetry_sdk::runtime::Tokio)
    .unwrap();

let layer = tracing_opentelemetry::layer()
    .with_tracer(otlp_tracer)
    .with_filter(EnvFilter::from("info"))
    .boxed();

and it works.

Now with these deps:

opentelemetry = { version = "0.23.0", default-features = false, features = [
    "trace",
] }
opentelemetry-http = { version = "0.12.0", default-features = false }
opentelemetry-otlp = { version = "0.16.0", default-features = false, features = [
    "http-proto",
] }
opentelemetry_sdk = { version = "0.23", default-features = false, features = [
    "rt-tokio",
] }

I'm getting this error:

error[E0277]: the trait bound `opentelemetry_sdk::trace::Tracer: opentelemetry::trace::tracer::Tracer` is not satisfied
    |
91  |             .with_tracer(otlp_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 `tracing_opentelemetry::OpenTelemetryLayer::<S, T>::with_tracer`
   --> C:\Users\User\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tracing-opentelemetry-0.23.0\src\layer.rs:581:17
    |
579 |     pub fn with_tracer<Tracer>(self, tracer: Tracer) -> OpenTelemetryLayer<S, Tracer>
    |            ----------- required by a bound in this associated function
580 |     where
581 |         Tracer: otel::Tracer + PreSampledTracer + 'static,
    |                 ^^^^^^^^^^^^ required by this bound in `OpenTelemetryLayer::<S, T>::with_tracer`

How can I fix?

From open-telemetry/opentelemetry-rust#1779.

@mladedav
Copy link
Contributor

There are already open PRs in #131 and #139 to update. For now, you cannot update your opentelemetry dependencies if you want to use tracing-opentelemetry

@frederikhors
Copy link
Author

@mladedav is this the same for version 0.26, right? I'm having the same error. Should I wait for the 0.27 version, right?

@djc
Copy link
Collaborator

djc commented Oct 2, 2024

See #169.

If keeping this up to date is so important to you, I'd be happy to sell you commercial support. If not, please don't open/comment on issues within 2 workdays after an upstream release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants