Status: Private beta. Tracing, metrics and logging are part of the server build that is still in progress. This page describes the intended setup.

Traces (OpenTelemetry)

Trace export is set with environment variables, not in the settings file: Span names: A trace links the session, each turn and each tool call, so you can follow one turn from the client request through the model call and the worker’s tool run. The collector is something you run. The server sends spans only to the endpoint you set.

Metrics (Prometheus)

Metrics are off by default. Turn them on in the settings file:
  • Metrics are served on their own listener, 127.0.0.1:9464 by default. Prometheus listens on 127.0.0.1:9464 only unless you change listen. A listen address that is not on loopback starts, but the server logs a warning, because the listener has no login.
  • The main API port never serves /metrics. A request for it there gets 404.
  • The series are separate from any hosted Allternit API metrics. All names start with allternit_selfhost_.
The gauges sessions, queue_depth, workers_online and store_up are read from the database, so with several replicas every replica reports the same value. Use one replica’s value, not the sum (for example max by (status)). Counters and histograms count what each replica did itself, so sum those. See Known limits. The listener has no TLS or login. To scrape from another machine, run a Prometheus agent on the same host or put a proxy in front, and limit who can reach it.

Logs

  • Logs go to stderr.
  • The format is JSON by default. Set observability.log_format: text for plain lines.
  • The server is built to keep secrets out of logs: API keys, environment keys, session secrets and provider credentials. Check your own log pipeline too.
With Docker Compose, read them with docker compose logs server and docker compose logs worker.

Health

  • GET /v1/server/info answers without a key and is a simple liveness check.
  • The server runs its own health checks every health.check_interval (default 60s).
  • allternit-agents-server admin doctor runs checks on demand. See Operations.