Metrics
| Variable | Default | Purpose |
|---|---|---|
RAN_METRICS_ADDR | :9550 | Prometheus metrics listen address (a single host:port; also serves /healthz) |
An empty value means the default :9550; there is no setting that switches the metrics server off (the health check uses the same listener). /metrics and /healthz are unauthenticated: publish the port on loopback only (127.0.0.1:9550:9550). A scraper in another container cannot reach the host loopback; put it on the same Docker network and scrape ran:9550.
Exposed metrics, besides ran_build_info{version,goversion} and the standard Go runtime and process collectors:
ran_connections_total{protocol,outcome}: connection counter. Outcomes:completed,timeout,error,too_long(line over the read limit),probe(the client did not speak the protocol)ran_credentials_captured_total{protocol}: credential capture counterran_active_sessions{protocol}: active session gaugeran_session_duration_seconds{protocol}: session duration histogram (buckets 0.1 s to 120 s)ran_crowdsec_alerts_dropped_total{protocol}: alerts dropped because the delivery queue was fullran_panics_recovered_total{protocol}: panics recovered at connection and packet boundariesran_proxy_protocol_dropped_total{protocol}: connections closed by the PROXY protocol listener (untrusted peer, no valid header, deadline, handshake limit, stalled consumer)ran_udp_rate_limited_total{protocol}: UDP packets dropped by the packet rate limiterran_sessions_rejected_total{protocol}: TCP connections and UDP packets rejected by the session limiter (RAN_MAX_SESSIONS,RAN_MAX_PER_IP)ran_probe_summary_suppressed_sessions_total: probe sessions whose per-session log lines were replaced by a summaryran_ignored_sessions_total{protocol}: sessions from sources inRAN_IGNORE_IPS(served and logged, never alerted; also counted inran_connections_total)ran_connections_rejected_total{reason}: TCP connections closed at accept time before a session existed;reasonisshun(RAN_SHUN), the only valueran_shun_active_sources: sources currently inside a shun windowran_tracked_entries{map}: entries in the bounded tracking maps (map:scan,probe,cooldown,offender)ran_tracked_evictions_total{map}: live entries evicted because a map was full; a rising rate meansRAN_CROWDSEC_MAX_TRACKEDis too smallran_crowdsec_push_duration_seconds: histogram of CrowdSec LAPI push request durationsran_crowdsec_push_errors_total: failed LAPI pushes (transport errors, non-2xx answers and failed re-logins after a 401)ran_crowdsec_queue_length: alerts waiting in the send queueran_crowdsec_pipeline_total{protocol,stage}: CrowdSec alert pipeline events. Stages:received,invalid(rejected source address),closed(raised after shutdown),filtered(class not inRAN_BAN_ON),cooldown(withinRAN_ALERT_COOLDOWN),queued,dropped,sent,failed,released(cooldown slot freed after a failed push, so the source is reported again). The 0.3.x stagescachedanddeduplicatedno longer exist. Per-class counts are not a label (cardinality); the class is in the alert meta and the logs.