Nostrfi
/Docs
Browse documentation
Owner: NostrfiLast reviewed: 2026-11-16

Observability

Health and readiness

  • /healthz returns 200 whenever the process can respond. It checks no dependencies.
  • /readyz returns 200 when the database answers a 2-second ping, and 503 otherwise. 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 :2112 inside the container, and the port is not published. Attach Prometheus to the Compose network and scrape relay:2112. Never publish it on 0.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

MetricTypeMeaning
relay_connections_activeGaugeOpen WebSocket connections
relay_messages_totalCounterMessages received, by type
relay_rejections_totalCounterRejections, by reason
relay_subscriptions_activeGaugeActive REQ subscriptions
relay_query_duration_secondsHistogramQuery duration, by query (req or negentropy)
relay_events_stored_totalCounterEvents stored. Ephemeral events are not counted.
relay_save_failures_totalCounterEvent save failures
relay_events_ephemeral_totalCounterEphemeral 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: /readyz failing 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.