open-telemetry / open-telemetry/opentelemetry-python
Plan for span event API deprecation
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 19
Description
Based on https://github.com/open-telemetry/opentelemetry-specification/pull/4430, the methods span.add_event and span.record_exception will eventually need to be deprecated. Usages of span.record_exception will need to be replaced by logging calls.
I discussed at length with @trask and @lmolkova what this means for SDKs like Python which automatically call span.record_exception within commonly used SDK conveniences like tracer.start_as_current_span. Essentially these will have to be deprecated too on the main Tracer classes since ordinary tracers shouldn't be coupled to the logging API. They can instead be added to specialised tracer classes (see https://github.com/open-telemetry/opentelemetry-js/blob/c6ab2ba4887d0cbbbdf3c1bda229440c67a8497e/api/src/experimental/trace/SugaredTracer.ts for an example) which aren't in the main API/SDK packages. These new packages can make major releases with breaking changes without causing as much disruption as in the core API/SDK packages. It seems that this is what should have been done in the first place since these kinds of conveniences aren't defined in the OTel API spec.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the referenced OpenTelemetry specification PR and the existing tracer.start_as_current_span convenience, including its use of span.record_exception. Compare the specialized SugaredTracer example in the linked JavaScript API and determine the Python API/SDK scope for deprecation and replacement logging calls. Done means an agreed plan for the deprecations and specialized tracer classes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, observability
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100