open-telemetry / open-telemetry/opentelemetry-cpp

[API] Clarify expectations for C++ exceptions, and usage of noexcept methods.

Open
#3,013 6 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug do-not-stale triage/accepted
Dominant language
C++
Stars
1.4k
Forks
632
Avg merge
1d 13h
Merged PRs (30d)
75

Description

Several methods in the API are flagged as noexcept.

This is desirable, because adding instrumentation to an application (i.e., calling opentelemetry-cpp apis) should not make the application less stable.

In particular, any failure in the opentelemetry-cpp sdk or exporters should not propagate the exception up, taking the application down.

To comply with the noexcept contract, methods in the SDK implementation should never raise exceptions.

According to clang-tidy reports, this is not always the case.

This part should be revisited, to clarify expectations, and enforce the SDK implementation complies.

cc @msiddhu

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.

Research direction

Start with the clang-tidy reports mentioned in the issue and review the API methods marked noexcept, including SDK and exporter implementations. Clarify the expected exception behavior and identify which reported paths violate that contract. Done means the expectations are documented and the relevant implementation paths comply without propagating exceptions.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api, observability
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.