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

v0.25.0 otlp example fails #157

Closed
Taxalo opened this issue Jul 24, 2024 · 3 comments
Closed

v0.25.0 otlp example fails #157

Taxalo opened this issue Jul 24, 2024 · 3 comments

Comments

@Taxalo
Copy link

Taxalo commented Jul 24, 2024

Bug Report

Version

0.25.0, latest jaeger (1.59.0)

Platform

macOS

Explaining

opentelemetry-otlp example returns an error and is not consistent generating traces.

executing the example opentelemetry-otlp with cargo run --example opentelemetry-otlp it returns the following:

    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.21s
     Running `target/debug/examples/opentelemetry-otlp`
2024-07-24T18:36:12.618578Z  INFO foo: opentelemetry_otlp: handle foo monotonic_counter.foo=1 key_1="bar" key_2=10
2024-07-24T18:36:12.618741Z  INFO foo: opentelemetry_otlp: histogram example histogram.baz=10
{"resourceMetrics":{"resource":{"attributes":[{"key":"deployment.environment","value":{"stringValue":"develop"}},{"key":"service.version","value":{"stringValue":"0.25.0"}},{"key":"service.name","value":{"stringValue":"tracing-opentelemetry"}}]},"scopeMetrics":[{"scope":{"name":"tracing/tracing-opentelemetry","version":"0.25.0"},"metrics":[{"name":"foo_named","sum":{"dataPoints":[{"attributes":[{"key":"key_1","value":{"stringValue":"bar"}}],"startTime":"2024-07-24 18:36:12.618","time":"2024-07-24 18:36:12.623","startTimeUnixNano":1721846172618688000,"timeUnixNano":1721846172623969000,"value":1}],"aggregationTemporality":"Cumulative","isMonotonic":true}}]}],"schemaUrl":"https://opentelemetry.io/schemas/1.26.0"}}
Other("[ExportErr(Status { code: Unimplemented, message: \", detailed error message: unknown service opentelemetry.proto.collector.metrics.v1.MetricsService\" })]")

The last line contains an unimplemented error, regarding the metrics service.
The traces that this example would generate, are generated RANDOMLY (sometimes appear on jaeger, sometimes don't) when executing the example, even tho we are getting an error.

If we execute this same example in v0.24.0 we get the following:

    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.07s
     Running `target/debug/examples/opentelemetry-otlp`
2024-07-24T18:44:48.482155Z  INFO foo: opentelemetry_otlp: handle foo monotonic_counter.foo=1 key_1="bar" key_2=10
2024-07-24T18:44:48.482344Z  INFO foo: opentelemetry_otlp: histogram example histogram.baz=10
{"resourceMetrics":{"resource":{"attributes":[{"key":"service.version","value":{"stringValue":"0.24.0"}},{"key":"service.name","value":{"stringValue":"tracing-opentelemetry"}},{"key":"deployment.environment","value":{"stringValue":"develop"}}]},"scopeMetrics":[{"scope":{"name":"tracing/tracing-opentelemetry","version":"0.24.0"},"metrics":[{"name":"foo_named","sum":{"dataPoints":[{"attributes":{"key_1":{"stringValue":"bar"}},"startTime":"2024-07-24 18:44:48.482","time":"2024-07-24 18:44:48.494","startTimeUnixNano":1721846688482274000,"timeUnixNano":1721846688494701000,"value":1}],"aggregationTemporality":"Cumulative","isMonotonic":true}}]}],"schemaUrl":"https://opentelemetry.io/schemas/1.25.0"}}

No error, works as expected, and it generates the traces every time we execute it.

If we revert the changes made to the example, and change a little bit the method to work with the new version changes, It will not work as well.

Tried downgrading jaeger, and error keeps happening.

The error seems to be coming from the following code, when an OtelGuard is dropped:

 impl Drop for OtelGuard {
    fn drop(&mut self) {
        if let Err(err) = self.meter_provider.shutdown() { // <- ERROR HAPPENS HERE
            eprintln!("{err:?}");
        }
        opentelemetry::global::shutdown_tracer_provider();
    }
}
@djc
Copy link
Collaborator

djc commented Jul 25, 2024

I probably won't have time to look into this in detail. Would suggest looking through the opentelemetry-otlp changelog in some detail to see if something stands out.

@Taxalo
Copy link
Author

Taxalo commented Jul 25, 2024

@djc
Copy link
Collaborator

djc commented Jul 25, 2024

Okay, I recommend you open an issue against the upstream repo, then.

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

2 participants