open-telemetry / open-telemetry/opentelemetry-python-contrib
Random connection reset errors affecting Celery
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 1.1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 16
Description
Describe your environment
- Centralised AWS OTEL Collector (latest, although same issue with older versions)
- AWS Application Load Balancer fronting the collector
- The collector debug logs have lines such as
loopyWriter exiting with error: transport closed by client - Only affects Celery workers in my stack, Gunicorn and others are unaffected
- Python 3.9
- Current versions of OpenTelemetry
opentelemetry-api==1.24.0
opentelemetry-distro==0.45b0
opentelemetry-exporter-otlp==1.24.0
opentelemetry-exporter-otlp-proto-common==1.24.0
opentelemetry-exporter-otlp-proto-grpc==1.24.0
opentelemetry-exporter-otlp-proto-http==1.24.0
opentelemetry-instrumentation==0.45b0
opentelemetry-instrumentation-botocore==0.45b0
opentelemetry-instrumentation-celery==0.45b0
opentelemetry-instrumentation-dbapi==0.45b0
opentelemetry-instrumentation-django==0.45b0
opentelemetry-instrumentation-logging==0.45b0
opentelemetry-instrumentation-psycopg2==0.45b0
opentelemetry-instrumentation-redis==0.45b0
opentelemetry-instrumentation-requests==0.45b0
opentelemetry-instrumentation-wsgi==0.45b0
opentelemetry-propagator-aws-xray==1.0.1
opentelemetry-proto==1.24.0
opentelemetry-sdk==1.24.0
opentelemetry-sdk-extension-aws==2.0.1
opentelemetry-semantic-conventions==0.45b0
opentelemetry-util-http==0.45b0
Steps to reproduce
Run a task on a Celery worker with opentelemetry-instrument.
What is the expected behavior?
No errors reported.
What is the actual behavior?
Any task a Celery worker executes results in an HTTP connection reset error or gRPC equivalent, but the traces are still sent successfully.
Additional context
I'm not getting these errors on non-Celery processes such as Gunicorn, etc.
It's incredibly challenging to diagnose this issue, so I'm not certain whether it's an issue with my stack or how Celery is handling auto instrumentation.
Anyone else seen this issue?
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 reproducing a task on a Celery worker with opentelemetry-instrument and compare its HTTP or gRPC errors with the unaffected Gunicorn process. Investigate the collector's "transport closed by client" log alongside the listed OpenTelemetry package versions; done means Celery tasks complete without connection-reset errors while traces remain successfully exported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- backend, observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100