- Docs
- Nostrfi Relay
- Operations
- Observability
Observability
Health and readiness
/healthzreturns200whenever the process can respond. It checks no dependencies./readyzreturns200when the database answers a 2-second ping, and503otherwise. Use it for load-balancer, orchestrator, and container health checks, and as the primary "is the relay up" signal.
Both are on the relay's public listener.
Where metrics are served
/metrics serves Prometheus-format metrics on a separate listener,
server.metrics_listen_addr, which defaults to 127.0.0.1:2112. It is not on
the public port and has no authentication, so where it is bound is its access
control.
- Docker Compose: the relay binds
:2112inside the container, and the port is not published. Attach Prometheus to the Compose network and scraperelay:2112. Never publish it on0.0.0.0. - A binary on a host: the default suits a Prometheus on the same host. For a remote scraper, bind an interface it can reach and firewall it.
Metrics
| Metric | Type | Meaning |
|---|---|---|
relay_connections_active | Gauge | Open WebSocket connections |
relay_messages_total | Counter | Messages received, by type |
relay_rejections_total | Counter | Rejections, by reason |
relay_subscriptions_active | Gauge | Active REQ subscriptions |
relay_query_duration_seconds | Histogram | Query duration, by query (req or negentropy) |
relay_events_stored_total | Counter | Events stored. Ephemeral events are not counted. |
relay_save_failures_total | Counter | Event save failures |
relay_events_ephemeral_total | Counter | Ephemeral events (kinds 20000–29999) accepted and broadcast without being stored. Added in 0.3.0. |
The type and reason labels are bounded to known values, so clients can't
inflate cardinality. No metric includes event content or pubkeys. The
standard Go runtime and process metrics are served too.
The admin dashboard shows these metrics live, without storing them.
Provisional dashboard and alerts
There is no approved service-level objective yet, so these are a conservative starting point, not targets.
Dashboard panels: connections, message rate by type, rejection rate by reason, subscriptions, p95 query latency, storage growth with save failures, and readiness.
Alerts:
- Relay down:
/readyzfailing for more than 2 minutes. - Save failures: any sustained non-zero rate for 5 minutes.
- Elevated rejection rate and query latency: thresholds deliberately unset. Choose them after observing normal traffic.
Distributed tracing is not implemented.
Previous
ModerationNext
Protocol support