Expose OTel metrics on :9464 for Prometheus to scrape

Alloy 404s OTLP metrics, so each service gets a MeterProvider with a
PrometheusMetricReader (same Resource as traces) served by
prometheus_client on its own port instead of a FastAPI route: gateway's
port 8000 is publicly routed by Traefik, and the audit worker has no HTTP
app. Host/port come from OTEL_EXPORTER_PROMETHEUS_HOST/PORT. Setting the
provider before the instrumentors also turns on their built-in HTTP and
DB pool metrics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Movses Aslanyan
2026-10-13 21:56:06 +03:30
co-authored by Claude Opus 5.5
parent 44d7801617
commit 7cb3231226
2 changed files with 20 additions and 1 deletions
+2
View File
@@ -11,3 +11,5 @@ python-multipart==0.0.20
structlog==25.5.0
opentelemetry-distro==0.66b1
opentelemetry-exporter-otlp==1.45.1
opentelemetry-exporter-prometheus==0.66b1
prometheus-client==0.26.0