open-telemetry / open-telemetry/opentelemetry-python
Configurable number of export attempts
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 19
Description
Hello
Perhaps this question has already been asked, but after looking through all the issues I have not found anything similar. At the moment we are using grpc-exporter to collect code execution time. But sometimes it happens that the metrics collector is unavailable. Because of this, the exporter may stop the whole service until sending attempts are finished. The logs at this time show the following: Transient error StatusCode.UNAVAILABLE encountered while exporting traces, retrying in 32s.
After looking at the source code, I noticed that we can't influence the number of attempts and delay time from the outside. In our case, one or two attempts are enough and if we fail to export, we are ready to move on rather than be distracted by meaningless retries with a long delay. The easiest option seems to be to do a max_value setting via the exporter constructor or from an environment variable. Or maybe I'm missing something and the number of attempts can be adjusted?
Thanks
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 in exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py around line 252, then trace how export retries and delays are configured. Done means callers can control the maximum attempts, including the requested one- or two-attempt behavior, without changing the service code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- grpc, python
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 40/100