You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Celery in python for task scheduling and instrumenting with
I think there's a bug, we are adding correct hostname in metrics but are adding origin in spans attributes.
However, origin is the celery worker thread id eg gen8@e338b12745fd This ID is defined by concurrency level. Eg if concurrency=11, there would be 11 such origins.
eg:
1 celery worker -> 1 host id: celery@66c3e95a829e
concurrency=11 -> 11 origins: gen8@e338b12745fd , gen8@38813890dc6e and so on.
in spans both this should be appended i.e. origin and worker_id
Describe your environment
OS: (e.g, Ubuntu)
Python version: (e.g., Python 3.8.10)
Package version: (e.g., 0.46.0)
What happened?
When using Celery in python for task scheduling and instrumenting with
I think there's a bug, we are adding correct hostname in metrics but are adding origin in spans attributes.
However, origin is the celery worker thread id eg
gen8@e338b12745fd
This ID is defined by concurrency level. Eg if concurrency=11, there would be 11 such origins.eg:
1 celery worker -> 1 host id:
celery@66c3e95a829e
concurrency=11 -> 11 origins:
gen8@e338b12745fd
,gen8@38813890dc6e
and so on.in spans both this should be appended i.e. origin and worker_id
relavent code:
https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py#L208
https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py#L214
https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/utils.py#L81
Celery Host:
Stack Trace Dump from Celery:
Current span attribute
Metric span attribute for hostname
Steps to Reproduce
Run Celery and use OTeL instrumentation (either SDK or Auto instrumentation)
Toy example to try out: https://github.com/shivanshuraj1333/celery-opentelemetry-instrumentation
Run:
and checkout metrics and span attributes
Expected Result
celery.hostname should be consistent in spans and traces, and should not be confused with origin
Actual Result
celery.hostname should show actual hostname that is being shown in metrics as well
Additional context
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: