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
{{ message }}
Repository navigation
An https:// OTLP gRPC endpoint gets the "sending telemetry unencrypted" warning #333
OpenTelemetryConfig.__post_init__ warns "OTLP exporter sending telemetry unencrypted to non-local host ..." for every gRPC endpoint that _parse_remote_insecure_host (lite_bootstrap/instruments/opentelemetry_instrument.py:103-120) reports. That method returns the host whenever opentelemetry_insecure is truthy (default True) and the host is not local, whatever the scheme. The gRPC exporter, though, forces TLS for an https scheme even when insecure=True is passed (opentelemetry/exporter/otlp/proto/grpc/exporter.py:316-317 in 1.44; the 1.28 floor does the same at :208-218). So OpenTelemetryConfig(opentelemetry_endpoint="https://collector.example.com:4317") warns while the exporter's _insecure is False. Reproduced on 705d8a3 while checking #322.
The warning is wrong on the safe side: telemetry is encrypted, and the user is told to change a setting that has no effect.
Work
Test first: OpenTelemetryConfig(opentelemetry_endpoint="https://collector.example.com:4317") with the default opentelemetry_insecure emits no warning (warnings.simplefilter("error"), next to test_opentelemetry_config_no_warning_for_local_endpoints in tests/instruments/test_opentelemetry_instrument.py). It fails today.
In _parse_remote_insecure_host, return None when the parsed scheme is https. urlparse lowercases the scheme, so HTTPS:// is covered.
Keep test_opentelemetry_config_warns_for_remote_endpoints (:234-247) as it is: schemeless, http:// and grpc:// endpoints still warn.
Verify: the new test and the existing insecure-warning tests pass.
Not breaking: one false-positive warning goes away. #322 later changes how the effective value is resolved; this fix stands either way.
Activity