Propagate traces over HTTP and add Redis spans

setup_telemetry now instruments httpx and redis process-wide. Both patch
the client classes, so clients created at import time (gateway's
_proxy_client, common.redis_client) are covered too. httpx CLIENT spans
inject traceparent, so the downstream FastAPI SERVER spans join the
caller's trace. gateway and fraud get setup_telemetry, the FastAPI span,
and the OTLP auth header. All seven services now export traces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Movses Aslanyan
2026-10-13 11:28:03 +03:30
co-authored by Claude Opus 5.5
parent ec6ddb6a26
commit 14938ab36b
4 changed files with 29 additions and 0 deletions
+4
View File
@@ -86,6 +86,8 @@ services:
environment:
<<: *app-env
SERVICE_NAME: gateway
env_file:
- .env.observability
command: uvicorn services.gateway.app:app --host 0.0.0.0 --port 8000 --reload --no-access-log
ports:
- "8000:8000"
@@ -128,6 +130,8 @@ services:
environment:
<<: *app-env
SERVICE_NAME: fraud
env_file:
- .env.observability
command: uvicorn services.fraud.app:app --host 0.0.0.0 --port 8002 --reload --no-access-log
ports:
- "8002:8002"