Skip to main content
OtelTracingMiddleware creates event and handler spans with parent-child linking.

Constructor params

  • tracer / Tracer: optional explicit OpenTelemetry tracer instance.
  • trace_api: optional explicit opentelemetry.trace module in Python/TypeScript.
  • root_span_attributes / RootSpanAttributes: attributes added to top-level event spans.

Setup with EventBus

Setup with Sentry

Install requirements:

Behavior

  • Starts an event span when an event starts and ends it on completion.
  • Starts one child span per handler execution.
  • Records handler exceptions on handler spans.
  • Links child events to parent handler spans where available.
  • With Sentry OpenTelemetry integration enabled, these spans are exported to Sentry performance traces.