open-telemetry / open-telemetry/opentelemetry-python

make record_exception api consistent

Open
#4,541 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request question
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?

Each language api has a different function signature for record_exception.
The common base is having exception and attributes as function parameters. Java and Ruby have only these two which I do believe is the right version.

In Python however, we have additional parameters: timestamp and escaped. Now, escaped appears nowhere in the documentation. The timestamp parameter is more debatable but for the sake of consistency, I would argue in favor of deleting it as well.

Describe the solution you'd like

Remove timestamp and escaped from the record_exception function signature. If it accepted, I would like to do the same in the javascript api.

Describe alternatives you've considered

No response

Additional Context

No response

Would you like to implement a fix?

Yes

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 by locating the Python record_exception entry point and its tests, then inspect how timestamp and escaped are documented or used. Update the signature to retain only exception and attributes, adjust affected tests or documentation, and confirm the Python API tests pass with the consistent signature.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.