OpenTelemetry Celery Instrumentation

Instrument celery to trace Celery applications.

Usage

  • Start broker backend

docker run -p 5672:5672 rabbitmq
  • Run instrumented task

from opentelemetry.ext.celery import CeleryInstrumentor

CeleryInstrumentor().instrument()

from celery import Celery

app = Celery("tasks", broker="amqp://localhost")

@app.task
def add(x, y):
    return x + y

add.delay(42, 50)

API

class opentelemetry.ext.celery.CeleryInstrumentor[source]

Bases: opentelemetry.instrumentation.instrumentor.BaseInstrumentor