Observability

Observability #

There are three ways to see what a node is doing: the HTTP endpoints, the INFO command, and pprof. All three are opt-in.

HTTP endpoints #

./bin/IceFireDB --metrics --metrics-addr 127.0.0.1:11002 -d /var/lib/icefiredb
PathResponseUse
/healthz200 ok whenever the process is upLiveness probe
/readyz200 ready once the storage backend has initialized; 503 not ready before thatReadiness probe / rollout gate
/metricsPrometheus text expositionScraping

The server is a plain http.Server with a 5-second ReadHeaderTimeout; it has no authentication, so keep it on loopback or a private interface (see Security).

Metrics exposed #

The registry is not the global one — it registers exactly:

MetricTypeMeaning
icefiredb_connected_clientsgaugeRESP connections currently open
go_*collectorGo runtime (goroutines, GC, memstats, …)
process_*collectorProcess CPU, RSS, FDs, start time

There are no Raft metrics, no per-command counters and no latency histograms. Command and storage counters live in INFO instead (below). Scrape interval and alerting should lean on up, icefiredb_connected_clients and container-level signals.

# prometheus.yml
scrape_configs:
  - job_name: icefiredb
    static_configs:
      - targets: ["127.0.0.1:11002"]

INFO #

INFO takes no arguments — INFO memory is an argument error, unlike Redis. It answers one bulk string with five sections, then one section per backend that registers extra metrics.

# Server
os:linux
arch:amd64
process_id:1
addr:127.0.0.1:11001
http_addr:
readonly:false
goroutine_num:38
gomaxprocs:8
thread_num:12
cgo_call_num:0
resp_client_num:1
ledisdb_version:...
# Store
name:goleveldb
get:0
get_missing:0
put:0
delete:0
get_total_time:0s
iter:0
iter_seek:0
iter_close:0
batch_commit:0
batch_commit_total_time:0s
# Mem
mem_alloc:... mem_sys:... mem_heap_alloc:... mem_head_objects:...
# GC
gc_last_time:... gc_num:... gc_pause_total:... gc_pause_history:...
SectionFieldsNotes
Serveros, arch, process_id, addr, http_addr, readonly, goroutine_num, gomaxprocs, thread_num, cgo_call_num, resp_client_num, ledisdb_versionaddr is the configured bind address; readonly comes from the ledis config and is always false here
Storename, get, get_missing, put, delete, get_total_time, iter, iter_seek, iter_close, batch_commit, batch_commit_total_timeCounters are per-process, reset on restart
Memmem_alloc, mem_sys, mem_looksups, mem_mallocs, mem_frees, mem_total, mem_heap_alloc, mem_heap_sys, mem_head_idle, mem_head_inuse, mem_head_released, mem_head_objectsHuman-readable sizes (1.234G)
GCgc_last_time, gc_num, gc_pause_total, gc_pause_historyLast five pauses
Driver sectionssee belowOnly for backends that implement Metrics()

Driver sections appended by main.go:

  • hybriddb: read_operations, write_operations, delete_operations, bytes_read, bytes_written, errors, uptime, closed.
  • ipfs, ipfs-synckv, oss: a hybriddb cache section (the title is a copy-paste in the drivers) with Ristretto counters — used_cost, cost_added, cost_evicted, hits, misses, ratio, keys_added, keys_evicted, keys_updated, gets_kept, gets_dropped, sets_dropped, sets_rejected.

INFO is a read command: it is served by the node you ask, never replicated, and a follower answers locally.

pprof #

./bin/IceFireDB --pprof --pprof-addr 127.0.0.1:26063 -d /var/lib/icefiredb
go tool pprof http://127.0.0.1:26063/debug/pprof/heap

Standard net/http/pprof handlers: /debug/pprof/{profile,heap,goroutine,block,mutex,trace}. Same caveat as /metrics — no auth, loopback by default.

Cluster state #

Cluster and Raft state are exposed as commands rather than metrics:

redis-cli -p 11001 RAFT LEADER       # advertise address of the current leader
redis-cli -p 11001 RAFT INFO         # raft state/term/index snapshot
redis-cli -p 11001 RAFT SERVER LIST  # id, address, leader flag per member
redis-cli -p 11001 CLUSTER INFO      # cluster_state:ok/fail, cluster_known_nodes, cluster_size
redis-cli -p 11001 CLUSTER NODES     # redis-cluster-shaped node lines
redis-cli -p 11001 MACHINE           # now / uptime / boottime from the Raft clock

MACHINE HUMAN returns the same values as RFC3339 timestamps and a Go duration. See System commands.

What to alert on #

SignalWhereMeaning
/readyz non-200HTTP probeStorage did not initialize — the node must not take traffic
up{job="icefiredb"}PrometheusThe node or its metrics endpoint is gone
-CLUSTERDOWN, -MOVED stormsYour client metricsWrite path cannot find a leader; check quorum
resp_client_num growthINFO ServerConnection leak in the client pool
get_missing / put ratioINFO StoreRead misses dominating — cache hit-rate or dataset problem
gc_pause_total slopeINFO GCAllocation pressure, usually large replies or big pipelines