Skip to content

Observability

The coordinator writes JSON logs to standard output, serves Prometheus metrics at /metrics, and can send OpenTelemetry traces. It has two health endpoints. It sends nothing to Zentri’s authors.

Logs are JSON lines on standard output, one object per line, written with Go’s log/slog. The level is fixed at INFO. No setting changes it.

The coordinator logs one line per HTTP request:

{"time":"...","level":"INFO","msg":"request","method":"POST","route":"/v1/sessions/{session_id}/heartbeat","status":200,"duration_ms":4}
Field Value
method The HTTP method.
route The route pattern, never the raw path, so IDs do not appear. unmatched when no route matched.
status The status code sent.
duration_ms The time to answer, in milliseconds.
via, token_id Only when an integration acts for a user, such as the Slack bot. via names the channel. token_id is the integration token’s ID.

Requests to /healthz, /readyz and /metrics are not logged, so probes do not fill the log.

When a handler fails with an unexpected error, the line is ERROR with the message request failed and an error field. The client gets only 500 with {"error":{"code":"internal","message":"internal error"}}. Look for the detail in the log.

Other lines you will see:

Message Level When
listening INFO The server is ready. Carries addr, version, tracing, embedding_model and llm.
stopped INFO The server shut down cleanly.
applied migration, migrations up to date INFO Migrations ran. See Upgrades and migrations.
raw prompts are not stored INFO ZENTRI_DATA_KEY_FILE is unset.
the LLM judge is off WARN An LLM is set, but ZENTRI_DATA_KEY_FILE is not.
intents: model step failed, continuing degraded WARN A model call failed. Carries step and a short reason, never the model’s reply.

Before a line is written, every Zentri token in it is cut to its prefix. zt_u_, zt_s_, zt_a_, zt_i_ and ztinv_ followed by letters and digits become the prefix and [REDACTED], such as zt_s_[REDACTED]. This applies to the message and to every field, including errors.

GET /metrics serves Prometheus text. The full list, with every label value, is in the metrics reference.

Metric Type Labels
zentri_http_requests_total Counter route, method, code
zentri_http_request_duration_seconds Histogram route, method
zentri_claims_total Counter outcome: granted, renewed, denied, released, expired
zentri_sessions_abandoned_total Counter None
zentri_rate_limited_total Counter limiter: session_token, user_token, anonymous, claims
zentri_intents_registered_total Counter class, resolution
zentri_intent_degraded_total Counter step: extract, embed, judge
zentri_slack_deliveries_total Counter outcome: delivered, retried, dead

The endpoint also serves the standard Go runtime (go_*) and process (process_*) metrics. The route label is the route pattern, so its values are bounded.

The coordinator listens on /metrics needs
Loopback only, such as 127.0.0.1:8080 or localhost:8080 No token
Anything else, such as :8080 An admin token, or an integration token with metrics:read

An address with no host, like the default :8080, listens on every interface, so it needs a token. In Compose the server listens on :8080 inside the container, so /metrics always needs a token there.

Create a token for Prometheus as an admin with POST /v1/integration-tokens and the scope metrics:read. See Security hardening. Then point Prometheus at a file that holds it:

scrape_configs:
- job_name: zentri
metrics_path: /metrics
scheme: https
authorization:
type: Bearer
credentials_file: /etc/prometheus/zentri-token
static_configs:
- targets: ["zentri.example.com"]
Signal What it can mean
zentri_intent_degraded_total rising The model server is slow or down. Dedup falls back to the offline path.
zentri_rate_limited_total{limiter="anonymous"} rising Failed logins, or many clients behind one proxy. See Security hardening.
zentri_slack_deliveries_total{outcome="dead"} rising Slack messages are given up on. Check the Slack bot.
zentri_http_requests_total{code="500"} Look for request failed lines in the log.

Tracing is off until you set OTEL_EXPORTER_OTLP_ENDPOINT. With it set, the coordinator sends spans over OTLP/HTTP to that endpoint. The listening log line shows "tracing":true.

Terminal window
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
  • The exporter is the OpenTelemetry Go OTLP/HTTP exporter. It reads its other settings from the standard OTEL_EXPORTER_OTLP_* variables, such as headers and timeout. Zentri’s tests do not cover those.
  • Every span has service.name set to zentri-server and service.version set to the build version.
  • Each HTTP request is one span, named after its method and route pattern, such as POST /v1/sessions/{session_id}/heartbeat.
  • The coordinator reads and passes on W3C Trace Context and Baggage headers.
  • On shutdown it waits up to 5 seconds to send the spans it still holds.

If the exporter cannot be set up, the server does not start and prints tracing: followed by the cause.

Endpoint Token Answers
GET /healthz None 200 {"status":"ok"} while the process runs.
GET /readyz None 200 {"status":"ready"} when Postgres answers a ping within 2 seconds. Otherwise 503 {"status":"unavailable","reason":"database unreachable"}.
GET /v1/server A user token {"version":"...","embedder":"..."}. zt doctor reads it.

Use /healthz for a liveness probe and /readyz for a readiness probe. Neither is rate limited or logged.

The server image has no shell, so a Docker health check cannot run inside it. Probe it from outside, as shown in Docker Compose.

zt stats shows what the coordinator did for one project over a window of days. Any role can run it.

Terminal window
zt stats --project web --days 14
Flag Default What it does
--project $ZENTRI_PROJECT, then the config Project name or ID.
--days 30 The window, 1 to 365 days.
--json Off Prints the API’s answer as JSON.

It prints one block per measure:

web, last 14 days (... to ...)
Duplicates prevented: 3
Tasks that matched running or finished work and were merged, queued, watched, or escalated instead of redone. ...
Conflicts avoided: 5
Edits refused because another session held the file, each repeat counted.
Answers reused: 1
Questions answered at once from an earlier answer a person gave.
Time to answer: median ..., 90th percentile ..., over 4 answers
...
Questions: 1 open, 4 answered, 0 expired
...
Decisions: 0 pending review, 2 approved, 0 rejected, 1 accepted as low risk
...
Model routing: 0 cheap, 0 frontier, 0 on the agent's own model
...

The numbers above are examples. The same data is at GET /v1/projects/{project_id}/stats. See the CLI reference.

Zentri sends no usage data to its authors or to anyone else. The coordinator makes outbound calls only to Postgres, to a model server you configure, and to a trace collector you configure.

  • The log level cannot be changed.
  • Logs go to standard output only. Ship them with your container runtime or service manager.
  • Rate limit refusals for notes, plans and snapshots are not counted in zentri_rate_limited_total.
  • No dashboards or alert rules ship with Zentri.