open-telemetry / open-telemetry/opentelemetry-python
BatchSpanProcessor doesn't cancel after export timeout duration
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 19
Description
Python implementation of BatchSpanProcessor doesn't cancel the export call after the EXPORT_TIMEOUT duration. An end user can pass a value or set an env var OTEL_BSP_EXPORT_TIMEOUT to instruct how long processor can wait for export before cancelling. Python implementation doesn't use it and waits for exporter to return https://github.com/open-telemetry/opentelemetry-python/blob/main/opentelemetry-sdk/src/opentelemetry/sdk/trace/export/__init__.py#L330-L336. Looking at the go implementation for comparison https://github.com/open-telemetry/opentelemetry-go/blob/main/sdk/trace/batch_span_processor.go#L213 it does cancel after export timeout. I am wondering if there was any deliberate reason for not doing (there is no easy way to achieve it in python?).
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 at opentelemetry-sdk/src/opentelemetry/sdk/trace/export/init.py around lines 330-336, then compare the referenced Go BatchSpanProcessor implementation. Determine how the configured EXPORT_TIMEOUT and OTEL_BSP_EXPORT_TIMEOUT should affect the export call; done means the Python processor cancels or stops waiting at that timeout, with behavior covered by appropriate tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- observability-sre
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100