Skip to content

Validate that configured TLS files exist for OTLP HTTP exporters - #5929

Open
Dotify71 wants to merge 1 commit into
open-telemetry:mainfrom
Dotify71:fix-otlp-http-tls-validation
Open

Dotify71 wants to merge 1 commit into
open-telemetry:mainfrom
Dotify71:fix-otlp-http-tls-validation

Conversation

@Dotify71

Copy link
Copy Markdown
Contributor

Description

Fixes #5928

In PR #5781, TLS/mTLS support was introduced in declarative configuration. While otlp_grpc validated certificate and key files at startup via _read_tls_file, otlp_http exporters only verified that key_file and cert_file were set together without checking whether the referenced files actually existed or could be read.

This meant missing certificates or typos in paths would not fail at configuration time, leading to silent failures or delayed errors when background worker threads attempted to export batches.

This change adds _validate_http_tls in _common.py, which:

  1. Validates the mTLS key/cert pair requirement.
  2. Checks that ca_file, cert_file, and key_file exist and can be read at startup, raising ConfigurationError to fail fast with a clear error message.
  3. Wires this validation into _create_otlp_http_span_exporter, _create_otlp_http_metric_exporter, and _create_otlp_http_log_exporter.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I am a human and not a bot
  • I have run tox -e precommit
  • I have run the relevant tests and linting tox environments (test-opentelemetry-configuration, lint-opentelemetry-configuration)

@Dotify71
Dotify71 requested a review from a team as a code owner November 12, 2026 16:57
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-11-15 08:31 UTC

Review the latest changes.

Also blocked by: Merge conflicts.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@Dotify71
Dotify71 force-pushed the fix-otlp-http-tls-validation branch from b3c8dfc to 72fcb1c Compare November 13, 2026 07:47

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

opentelemetry-configuration: OTLP HTTP exporter does not validate TLS files exist at startup

1 participant