-
Notifications
You must be signed in to change notification settings - Fork 441
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
[Bug]: OTLP exporter fails to send data to backend requiring TLS #2008
Comments
@alanwest I don't see any TLS config setting in the code above - are you setting any CA certificate(chain) in your example? Otherwise, the code is pretty similar to the basic-otlp example here - https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry-otlp/examples/basic-otlp, and should work with new otel v24. |
@lalitb Should I need to? I did not need to with v23. Is this a new requirement with v24? My expectation is that I should not need to provide any special TLS config in the default case. That is, the system's certificates should be loaded. I assume this was what was happening prior to v24 and is also the behavior of the other language SDKs. |
@alanwest From OpenTelemetry perspective, there is no change in how TLS config is handled. The only relevant change done in OpenTelemetry v0.24 is an upgrade to Tonic v0.12.0. There are a few changes regarding TLS in this release if it helps identify the issue: https://github.com/hyperium/tonic/releases/tag/v0.12.0 --clip tls: Add ability to add multiple ca certificates (hyperium/tonic#1724) (3457f92) -- |
Thanks for the sleuth work! The issue is specifically related to hyperium/tonic#1731. They acknowledge this as a breaking change in a follow up hyperium/tonic#1781. So in effect upgrading to this version also created a breaking change for opentelemetry-rust. I was really close to a solution in my original post. This is the tracer provider config that works (I missed calling the new let tracer_provider = opentelemetry_otlp::new_pipeline()
.tracing()
.with_exporter(opentelemetry_otlp::new_exporter().tonic()
.with_tls_config(tonic::transport::ClientTlsConfig::new().with_native_roots()))
.with_trace_config(Config::default().with_resource(resource))
.install_batch(runtime::Tokio)
.expect("failed to initialize the trace pipeline"); Personally, I'd prefer the Though, at a bare minimum, I think documenting this new required usage in the examples would be helpful. |
Tonic changed defaults that broke "how things worked" with otel open-telemetry/opentelemetry-rust#2008 Now be more explicit to enable the previous behavior
Tonic changed defaults that broke "how things worked" with otel open-telemetry/opentelemetry-rust#2008 Now be more explicit to enable the previous behavior
What happened?
The following code worked with opentelemetry/opentelemetry_sdk 0.23.0 and opentelemetry-otlp 0.16.0
I have the following environment variables set
OTEL_EXPORTER_OTLP_ENDPOINT=https://my-backend
OTEL_EXPORTER_OTLP_HEADERS=key-required-by-my-backend=value
Cargo.toml
main.rs
Then I upgraded to opentelemetry 0.24.0/opentelemetry_sdk 0.24.1/opentelemetry-otlp 0.17.0
Cargo.toml
main.rs
I receive the following error
I also tried
But this produces a different error as it does not seem to load the system's root certs
API Version
0.24.0
SDK Version
0.24.1
What Exporter(s) are you seeing the problem on?
OTLP
Relevant log output
The text was updated successfully, but these errors were encountered: