Carry trace context across the Redis Stream by hand

Redis Streams have no headers, so the gateway injects traceparent into
the message fields inside a PRODUCER span. The notifier and audit
consumers extract it and open one CONSUMER span per message, so their
DB and XACK spans join the transaction's trace. The idle XREADGROUP poll
runs under suppress_instrumentation (it was a ~2s root trace every loop),
and audit strips the trace fields so its stored payload is unchanged.

The gateway also stops tracing its frontend's /api/health/ polling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Movses Aslanyan
2026-10-13 17:46:51 +03:30
co-authored by Claude Opus 5.5
parent 14938ab36b
commit d1c158c835
4 changed files with 92 additions and 36 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ app = FastAPI(title=SERVICE_NAME)
FastAPIInstrumentor.instrument_app(
app,
excluded_urls="/healthz",
excluded_urls="/healthz,/api/health/",
exclude_spans=["receive", "send"],
)