Dev.to
7/15/2026

Instrumenting Asynchronous AI Agent Workflows with OpenTelemetry and
Original: # Tracking the Ghosts in the Machine: Instrumenting Asynchronous AI Agent Workflows with OpenTelemetry and SigNoz
Short summary
This tutorial explains how to instrument asynchronous AI agent workflows with OpenTelemetry and SigNoz, solving the problem of trace context being dropped when tasks move from FastAPI to Celery background workers. It covers manual context injection and extraction to maintain parent-child span relationships across queue boundaries, enabling end-to-end visibility from API request to final LLM token generation. Code examples show carrier-based propagation for both the producer and worker sides.
- •Standard auto-instrumentation drops trace context when tasks are serialized to background queues like Redis/Celery
- •Manual OpenTelemetry context injection and extraction bridges async boundaries to maintain full traces
- •SigNoz visualization connects the API request through vector DB queries, LLM calls, and post-processing into one trace
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



