Skip to main content

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​

VariableDefaultDescription
LOG_LEVELlog in production, debug otherwiseThe minimum log level: debug, log, warn, or error.

OpenTelemetry​

The OTEL_* variables are standard OpenTelemetry names, read before the rest of the configuration.

VariableDefault when enabledDescription
OTEL_SDK_DISABLEDtrueSet false, 0, or no to turn telemetry on.
OTEL_SERVICE_NAMEThe package.json name, then chat-apiThe service name.
OTEL_RESOURCE_ATTRIBUTES—Extra resource attributes, for example deployment.environment=staging.
OTEL_TRACES_EXPORTERotlpotlp or none.
OTEL_METRICS_EXPORTERprometheusAny of otlp, prometheus, and none, comma-separated. otlp,prometheus runs both, but ingesting both copies double-counts the process.
OTEL_LOGS_EXPORTERotlpotlp or none.
OTEL_EXPORTER_OTLP_ENDPOINThttp://localhost:4318The 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_HOST127.0.0.1The Prometheus listener address.
OTEL_EXPORTER_PROMETHEUS_PORT9464The Prometheus listener port.
OTEL_TRACES_SAMPLER, OTEL_TRACES_SAMPLER_ARGparentbased_always_onThe 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/health and GET /metrics, with trace context propagated to DIAL Core. Every traced response carries a traceparent header, 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​