Observability
The platform uses OpenTelemetry end-to-end. Every Node service, the Next.js web app, the Apollo Router, and the Traefik API gateway emit OTLP/gRPC to a single collector. Locally that's the .NET Aspire Dashboard; in Azure it's the Container Apps managed OTel agent, which forwards to Application Insights.
The shared instrumentation package is @repo/observability (packages/infrastructure/observability). All Node and Next.js services import from it; nothing should pull @opentelemetry/* packages in directly.
Goals
- One way to instrument a service. Apps choose a preset, not individual instrumentations.
- Every exception lands in App Insights, even when the surrounding trace is sampled out.
- Trace context propagates end-to-end across the native app, Traefik, the Apollo Router, the subgraphs, and the legacy API.
- Configuration lives in code; prod and local behave the same except for the collector endpoint.
Telemetry signals
| Signal | Producer | Local sink | Production sink |
|---|---|---|---|
| Traces | OTel SDK + auto-instrumentations (HTTP, Undici, GraphQL, Pino, Redis, …) | Aspire Dashboard | App Insights requests / dependencies |
| Logs | Pino → PinoInstrumentation (requires pino external in bundles) → NodeSDK Logs provider | Aspire Dashboard | App Insights traces |
| Exceptions | recordException() (BaseError, global handlers, Next.js error hook) | Aspire Dashboard | App Insights exceptions |
| Metrics | Not emitted — the Container Apps agent doesn't accept OTel metrics today | -- | -- |
Component map
Solid arrows are local; dotted arrows are production.
Subpages
- Instrumentation — how
@repo/observabilityis wired, the preset model, and the exception pipeline. - Local Development — the Aspire Dashboard, where to look for traces/logs/exceptions, and troubleshooting.
- Azure Container Apps — the managed OTel agent, per-app env vars, and per-env sampling ratios.
Related
- Architecture — Platform Overview
- ADR-001: Microservices Architecture
- API Patterns — Error Handling —
BaseErrorplugs into the exception pipeline - Local Development — Docker Compose — the
aspire-dashboardservice definition