Observability
The DIAL Chat BFF writes logs to the console and can export OpenTelemetry traces, logs, and metrics. Telemetry is off by default: with no OTEL_* variable set, the BFF opens no extra port and makes no telemetry calls. This reference is for platform engineers who monitor Chat; for the DIAL-wide setup, see Observability.
Logging
| Variable | Default | Description |
|---|---|---|
LOG_LEVEL | log in production, debug otherwise | The minimum log level: debug, log, warn, or error. |
OpenTelemetry
The OTEL_* variables are standard OpenTelemetry names, read before the rest of the configuration.
| Variable | Default when enabled | Description |
|---|---|---|
OTEL_SDK_DISABLED | true | Set false, 0, or no to turn telemetry on. |
OTEL_SERVICE_NAME | The package.json name, then chat-api | The service name. |
OTEL_RESOURCE_ATTRIBUTES | — | Extra resource attributes, for example deployment.environment=staging. |
OTEL_TRACES_EXPORTER | otlp | otlp or none. |
OTEL_METRICS_EXPORTER | prometheus | Any of otlp, prometheus, and none, comma-separated. otlp,prometheus runs both, but ingesting both copies double-counts the process. |
OTEL_LOGS_EXPORTER | otlp | otlp or none. |
OTEL_EXPORTER_OTLP_ENDPOINT | http://localhost:4318 | The collector endpoint for every signal. |
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, ..._METRICS_ENDPOINT, ..._LOGS_ENDPOINT | — | A per-signal endpoint override. |
OTEL_EXPORTER_OTLP_HEADERS | — | Headers for the collector, which may carry its credentials. |
OTEL_EXPORTER_PROMETHEUS_HOST | 127.0.0.1 | The Prometheus listener address. |
OTEL_EXPORTER_PROMETHEUS_PORT | 9464 | The Prometheus listener port. |
OTEL_TRACES_SAMPLER, OTEL_TRACES_SAMPLER_ARG | parentbased_always_on | The trace sampler. |
The OTLP exporters send HTTP/JSON; OTEL_EXPORTER_OTLP_PROTOCOL is not read. Batch and interval settings such as OTEL_BSP_*, OTEL_BLRP_*, and OTEL_METRIC_EXPORT_INTERVAL are read by the SDK.
Prometheus metrics only
OTEL_SDK_DISABLED=false
OTEL_METRICS_EXPORTER=prometheus
OTEL_TRACES_EXPORTER=none
OTEL_LOGS_EXPORTER=none
Metrics are served at /metrics on port 9464. The listener has no authentication, so it binds to 127.0.0.1, where a sidecar in the same pod can reach it. Set OTEL_EXPORTER_PROMETHEUS_HOST=0.0.0.0 only for a scraper outside the container, and restrict the port with a network policy.
An OTLP collector
OTEL_SDK_DISABLED=false
OTEL_METRICS_EXPORTER=otlp
OTEL_TRACES_EXPORTER=otlp
OTEL_LOGS_EXPORTER=otlp
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
What the BFF emits
- Traces: a server span for each incoming request, except
GET /api/healthandGET /metrics, with trace context propagated to DIAL Core. Every traced response carries atraceparentheader, and JSON error bodies repeat it. - Logs: the console logs, also exported through OpenTelemetry with the trace and span IDs when a trace is active.
- Metrics: request duration by route and status, HTTP transport lifecycle, generation outcomes and timing, sign-in, token refresh, and logout results, and process memory.
An unreachable collector never fails a request; it only produces exporter warnings. For the metric definitions and ready-made Grafana dashboards, see Backend observability in the DIAL Chat repository.
Further reading
- Observability overview — collect signals across DIAL
- Tracing — correlate Chat traces with DIAL Core
- Server and DIAL Core —
CHAT_VERSION, reported in the health check