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
Start the celery worker with celery -A celery_app worker
Now run the following python script
importloggingfromceleryimportCeleryfromopentelemetryimporttracefromopentelemetry.instrumentation.celeryimportCeleryInstrumentorfromopentelemetry.instrumentation.loggingimportLoggingInstrumentorfromopentelemetry.sdk.traceimportTracerProviderfromrich.loggingimportRichHandlerlogger=logging.getLogger(__name__)
# setup logginglogging.basicConfig(
level=logging.INFO,
format="[trace_id=%(otelTraceID)s span_id=%(otelSpanID)s]%(message)s",
datefmt="[%X]",
handlers=[RichHandler(rich_tracebacks=True)],
)
LoggingInstrumentor().instrument()
# Set up tracingtrace.set_tracer_provider(TracerProvider())
CeleryInstrumentor().instrument()
celery_app=Celery(
"worker",
broker="amqp://guest:guest@localhost:5672//",
backend="rpc://",
)
withtrace.get_tracer("sender").start_as_current_span("send_celery_task") asspan:
span.set_attribute("celery.task_name", "ping")
logger.info("Sending task to Celery")
celery_app.send_task("ping")
Note that the trace id are not the same in the script and the celery task when using opentelemetry-instrumentation-celery==0.50b0 and celery==5.5.0rc4. However they are the same if celery==5.4.0. Is it possible to make the instrumentation work with the release candidate?
The text was updated successfully, but these errors were encountered:
The current instrumentation of
celery
doesn't work with celery v5.5.0 release candidate.Minimal reproducible example
celery_app.py
Start the celery worker with
celery -A celery_app worker
Now run the following python script
Note that the trace id are not the same in the script and the celery task when using
opentelemetry-instrumentation-celery==0.50b0
andcelery==5.5.0rc4
. However they are the same ifcelery==5.4.0
. Is it possible to make the instrumentation work with the release candidate?The text was updated successfully, but these errors were encountered: