feat: add observability stack and background task infrastructure
Add OpenTelemetry instrumentation with distributed tracing and metrics: - Structured JSON logging with trace context correlation - Auto-instrumentation for FastAPI, asyncpg, httpx, redis - OTLP exporter for traces and Prometheus metrics endpoint Implement Celery worker and notification task system: - Celery app with Redis/SQS broker support and configurable queues - Notification tasks for incident fan-out, webhooks, and escalations - Pluggable TaskQueue abstraction with in-memory driver for testing Add Grafana observability stack (Loki, Tempo, Prometheus, Grafana): - OpenTelemetry Collector for receiving OTLP traces and logs - Tempo for distributed tracing backend - Loki for log aggregation with Promtail DaemonSet - Prometheus for metrics scraping with RBAC configuration - Grafana with pre-provisioned datasources and API overview dashboard - Helm templates for all observability components Enhance application infrastructure: - Global exception handlers with structured ErrorResponse schema - Request logging middleware with timing metrics - Health check updated to verify task queue connectivity - Non-root user in Dockerfile for security - Init containers in Helm deployments for dependency ordering - Production Helm values with autoscaling and retention policies
This commit is contained in:
@@ -15,6 +15,18 @@ dependencies = [
|
||||
"celery[redis]>=5.4.0",
|
||||
"redis>=5.0.0",
|
||||
"httpx>=0.28.0",
|
||||
# OpenTelemetry
|
||||
"opentelemetry-api>=1.27.0",
|
||||
"opentelemetry-sdk>=1.27.0",
|
||||
"opentelemetry-exporter-otlp>=1.27.0",
|
||||
"opentelemetry-exporter-prometheus>=0.48b0",
|
||||
"opentelemetry-instrumentation-fastapi>=0.48b0",
|
||||
"opentelemetry-instrumentation-asyncpg>=0.48b0",
|
||||
"opentelemetry-instrumentation-httpx>=0.48b0",
|
||||
"opentelemetry-instrumentation-redis>=0.48b0",
|
||||
"opentelemetry-instrumentation-logging>=0.48b0",
|
||||
"opentelemetry-instrumentation-system-metrics>=0.48b0",
|
||||
"prometheus-client>=0.20.0",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
|
||||
Reference in New Issue
Block a user