feat(observability): OpenTelemetry tracing + log/trace correlation
Adds OTel auto-instrumentation (http, express, prisma/pg, redis, ...) exporting OTLP to Tempo, so iios-service requests appear as distributed traces in Grafana. observability/tracing.ts is imported FIRST in main.ts — auto-instrumentation patches modules as they are require()d, so anything loaded earlier is never traced. Env-driven (OTEL_SERVICE_NAME / OTEL_EXPORTER_OTLP_ENDPOINT); with the endpoint unset the SDK never starts, so dev and tests carry zero overhead. Health/metrics probes are excluded — they would otherwise swamp Tempo and bury real request traces. The existing P9 trace middleware now adopts the ACTIVE OTel trace id, so an http.request log line and its distributed trace share one id (Loki -> Tempo pivot in Grafana), falling back to x-trace-id / traceparent / generated. pnpm-lock.yaml regenerated — CI and the Dockerfile both use 'pnpm install --frozen-lockfile', which would hard-fail on an unchanged lock. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -30,7 +30,10 @@
|
||||
"reflect-metadata": "^0.2.2",
|
||||
"rxjs": "^7.8.2",
|
||||
"socket.io": "^4.8.3",
|
||||
"web-push": "^3.6.7"
|
||||
"web-push": "^3.6.7",
|
||||
"@opentelemetry/api": "^1.9.1",
|
||||
"@opentelemetry/sdk-node": "^0.220.0",
|
||||
"@opentelemetry/auto-instrumentations-node": "^0.78.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@insignia/iios-testkit": "workspace:*",
|
||||
|
||||
Reference in New Issue
Block a user