Skip to content

[Bug]: Without the tls feature, the Tonic exporter sends unencrypted data to a HTTPS endpoint #3182

@Aaron1011

Description

@Aaron1011

What happened?

When using the default Cargo features for the opentelemetry-otlp crate, the tls feature is off by default. Enabling the grpc-tonic feature does not enable TLS.

With the environment variable OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://otlp.arize.com/v1 set, and using an exporter built with:

opentelemetry_otlp::SpanExporter::builder()
.with_tonic()
.build()

I observed plain HTTP (non-TLS) traffic being sent to otlp.arize.com (using Wireshark), even though my endpoint url explicitly mentions https Since the remote server is expecting TLS on port 443, the opentelemetry-otlp report tries to parse the server TLS error as plain HTTP, resulting in a confusing error message:

ERROR opentelemetry_sdk:  name="BatchSpanProcessor.ExportError" error="Operation failed: status: Unknown, message: \"transport error\", details: [], metadata: MetadataMap { headers: {} }"

I would expect that trying to using a https endpoint without the tls feature enabled produces an error, rather than silently attempting to use a non-encrypted connection on port 443.

OpenTelemetry API Version (i.e version of opentelemetry crate)

v0.30.0

OpenTelemetry SDK Version (i.e version of opentelemetry_sdk crate)

v0.30.0

What Exporter(s) are you seeing the problem on?

OTLP

Relevant log output

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions