open-telemetry / open-telemetry/opentelemetry-python

Address potential unhandled exceptions in OTLP exporters

Open
#5,050 4 comments 1 reaction 1 assignee View on GitHub

@herin049 is already working on this.

Since Apr 7, 2026.

bug
Dominant language
Python
Stars
2.6k
Forks
1k
Avg merge
4d 15h
Merged PRs (30d)
19

Description

Is your feature request related to a problem?

Under scenarios when invalid signal-specific objects as passed to OTLP exporters, an unhandled exception can be thrown which directly violates the requirements outlined by the spec: https://opentelemetry.io/docs/specs/otel/error-handling/

OpenTelemetry implementations MUST NOT throw unhandled exceptions at run time.

Two ways in which this issue can be addressed are:

  1. Update encode_metrics/encode_traces/encode_logs to NOT raise an exception, and instead log an error when unexpected data is encountered
  2. Update OLTP metric exporters to handle the exception, logging the error and returning an export failure result

For additional context see #4996.

Would you like to implement a fix?

Yes

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.