Docs

Observability

Built-in dashboards and sessions, the Prometheus /metrics endpoint with an optional bearer token, the exported metric names, and OpenTelemetry traces, metrics and logs.

Last updated: 2026-11-24 · Markdown

Neurouter measures every call and exposes the data three ways: built-in dashboards, a Prometheus endpoint and OpenTelemetry.

Built-in dashboards

Audit & observability → Overview shows tool calls, success and error rates, blocked calls and latency (p50, p95, p99), broken down by server, tool, agent and user. Data comes from per-minute rollups, kept for 14 days, and hourly rollups, kept for 400 days.

Sessions groups calls into sessions. Because the current MCP specification has no protocol sessions, a session is identified by, in order: a client-supplied _meta["dev.neurouter/session-id"], the trace ID from traceparent, the legacy Mcp-Session-Id header, or a 30-minute idle gap per agent.

Prometheus

GET /metrics serves Prometheus text format when METRICS_ENABLED=true (the default). If METRICS_TOKEN is set, scrapers must send it:

scrape_configs:
  - job_name: neurouter
    metrics_path: /metrics
    authorization:
      type: Bearer
      credentials: <METRICS_TOKEN>
    static_configs:
      - targets: ["neurouter:3000"]

On Kubernetes, set metrics.serviceMonitor.enabled=true (and metrics.token) in the Helm chart.

Metrics include:

MetricWhat it measures
neurouter_mcp_requests_totalMCP requests
neurouter_tool_calls_totalTool calls
neurouter_tool_call_duration_secondsTool call latency
neurouter_upstream_request_duration_secondsLatency of calls to upstream servers
neurouter_upstream_upUpstream server health
neurouter_upstream_circuit_openUpstream circuit breakers that are open
neurouter_rate_limited_totalCalls rejected by rate limits
neurouter_auth_failures_totalFailed authentications
neurouter_approvals_pendingCalls waiting for approval
neurouter_approval_wait_secondsTime calls waited for approval
neurouter_audit_queue_depthAudit events waiting to be written
neurouter_audit_flush_secondsAudit write latency
neurouter_audit_dropped_totalAudit events dropped
neurouter_embedding_queue_depth, neurouter_embedding_secondsTool search indexing

OpenTelemetry

OpenTelemetry is off by default. Enable it with OTEL_SDK_DISABLED=false and configure it with the standard variables:

OTEL_SDK_DISABLED=false
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
OTEL_SERVICE_NAME=neurouter
# optional: also export metrics over OTLP
OTEL_METRICS_EXPORTER=otlp
  • Traces are exported over OTLP/HTTP, covering incoming HTTP, outbound upstream calls (which carry traceparent) and PostgreSQL.
  • Metrics go over OTLP too when OTEL_METRICS_EXPORTER=otlp. Prometheus /metrics is always served.
  • Audit events can be exported as OTLP logs; enable it in Settings → Gateway settings → Export.
  • service.instance.id is added to the resource attributes automatically.

With Docker Compose, docker compose --profile otel up starts a collector that logs what it receives.

Health checks

GET /healthz (liveness, alias /health) and GET /readyz (database and audit store).