Skip to content

Prometheus Metrics

The bouncer exports Prometheus metrics when metrics.enabled is true. Metrics are available at http://<listen_addr>:<listen_port>/metrics.

Gauge Labels: ip_type

Number of currently active (banned) decisions by protocol version. Updated in real time during streaming ban/unban events and recalculated during reconciliation.

LabelValuesDescription
ip_typeipv4, ipv6Protocol version
# Total active decisions
sum(crowdsec_bouncer_active_decisions)
# IPv6 decisions only
crowdsec_bouncer_active_decisions{ip_type="ipv6"}

crowdsec_bouncer_active_decisions_by_origin

Section titled “crowdsec_bouncer_active_decisions_by_origin”
Gauge Labels: origin

Active decisions broken down by their source. Incremented/decremented in real time during streaming and reset during full reconciliation.

LabelValuesDescription
origincrowdsec, cscli, CAPI, lists:*Source of the decision
# Active decisions by origin
crowdsec_bouncer_active_decisions_by_origin
# Only community blocklist decisions
crowdsec_bouncer_active_decisions_by_origin{origin="CAPI"}

Counter Labels: action, origin, ip_type

Total number of decisions processed since startup. Counts both bans (action="ban") and unbans (action="unban").

# Ban rate per minute by origin
rate(crowdsec_bouncer_decisions_total{action="ban"}[5m]) * 60
# Total unbans since startup
sum(crowdsec_bouncer_decisions_total{action="unban"})

Counter Labels: component

Total errors by component (lapi, routeros, stream).

# Error rate across all components
rate(crowdsec_bouncer_errors_total[5m])

Gauge

Whether the bouncer has an active connection to RouterOS (1 = connected, 0 = disconnected).


crowdsec_bouncer_operation_duration_seconds

Section titled “crowdsec_bouncer_operation_duration_seconds”
Histogram Labels: operation

Duration of operations in seconds. Labels: operation="add", operation="remove", operation="reconcile".

# p99 add operation latency
histogram_quantile(0.99, rate(crowdsec_bouncer_operation_duration_seconds_bucket{operation="add"}[5m]))

Counter Labels: status

Total reconciliation runs. Labels: status="added", status="removed", status="unchanged".


Gauge Info metric (value always 1)

Bouncer build information with version label.


Gauge

Unix timestamp of when the bouncer process started.


Gauge Info metric (value always 1)

Exposes bouncer configuration as metric labels. Carries all configuration parameters as labels:

Full label list
LabelExample value
version1.3.0
crowdsec_urlhttp://localhost:8080/
crowdsec_update_frequency10s
crowdsec_include_scenarios_containing
crowdsec_exclude_scenarios_containing
crowdsec_only_include_decisions_from
crowdsec_originscrowdsec,cscli
crowdsec_scenarios
mikrotik_host192.168.88.1:8728
mikrotik_tlsfalse
mikrotik_pool_size4
firewall_deny_actiondrop
firewall_reject_with
firewall_rule_placementtop
firewall_filter_chainsinput
firewall_raw_chainsprerouting
firewall_ipv4_enabledtrue
firewall_ipv6_enabledtrue
firewall_filter_enabledtrue
firewall_raw_enabledtrue
firewall_logfalse
firewall_log_prefixcrowdsec-bouncer
firewall_comment_prefixcrowdsec-bouncer
firewall_block_outputfalse
firewall_input_interface
firewall_input_interface_list
firewall_input_whitelist
firewall_filter_connection_state
firewall_filter_log_prefix
firewall_raw_log_prefix
metrics_routeros_poll_interval30s
Gauge

Cumulative bytes dropped by all bouncer firewall rules.

Gauge

Cumulative packets dropped by all bouncer firewall rules.

Gauge Labels: proto New

Cumulative bytes dropped by firewall rules, broken down by protocol.

LabelValuesDescription
protoipv4, ipv6Protocol version
Gauge Labels: proto New

Cumulative packets dropped by firewall rules, broken down by protocol.

LabelValuesDescription
protoipv4, ipv6Protocol version
# Dropped bytes rate by protocol
rate(crowdsec_bouncer_dropped_bytes_by_proto[5m])
# Compare IPv4 vs IPv6 dropped traffic
crowdsec_bouncer_dropped_bytes_by_proto{proto="ipv4"}
crowdsec_bouncer_dropped_bytes_by_proto{proto="ipv6"}

Processed traffic metrics measure ALL traffic evaluated by the bouncer’s firewall chains — not just blocked traffic. The bouncer automatically creates action=passthrough counting rules positioned before each drop rule to track total chain throughput. These are the MikroTik equivalent of iptables JUMP counters used by cs-firewall-bouncer.

Gauge New

Cumulative bytes processed (evaluated) by all bouncer firewall rules.

Gauge New

Cumulative packets processed (evaluated) by all bouncer firewall rules.

Gauge Labels: proto New

Cumulative bytes processed by firewall rules, broken down by protocol.

LabelValuesDescription
protoipv4, ipv6Protocol version

crowdsec_bouncer_processed_packets_by_proto

Section titled “crowdsec_bouncer_processed_packets_by_proto”
Gauge Labels: proto New

Cumulative packets processed by firewall rules, broken down by protocol.

LabelValuesDescription
protoipv4, ipv6Protocol version
# Processed traffic rate by protocol
rate(crowdsec_bouncer_processed_bytes_by_proto[5m])
# Drop rate percentage (how much traffic is being blocked)
sum(crowdsec_bouncer_dropped_packets_total) / sum(crowdsec_bouncer_processed_packets_total) * 100

When metrics.routeros_poll_interval is non-zero, the bouncer collects MikroTik system metrics:

Gauge

CPU load percentage (0–100).

crowdsec_bouncer_routeros_memory_total_bytes

Section titled “crowdsec_bouncer_routeros_memory_total_bytes”
Gauge

Total system memory in bytes.

crowdsec_bouncer_routeros_memory_used_bytes

Section titled “crowdsec_bouncer_routeros_memory_used_bytes”
Gauge

Used system memory in bytes.

crowdsec_bouncer_routeros_cpu_temperature_celsius

Section titled “crowdsec_bouncer_routeros_cpu_temperature_celsius”
Gauge

CPU temperature in degrees Celsius.

Gauge New

RouterOS uptime in seconds. Parsed from the MikroTik uptime string format (e.g. 1w2d3h4m5s).

# Uptime in days
crowdsec_bouncer_routeros_uptime_seconds / 86400
Gauge Labels: version, board_name New

RouterOS system information as an info metric (value always 1). Labels expose the RouterOS version and hardware model.

LabelExampleDescription
version7.16.2RouterOS version
board_nameRB4011iGS+Hardware model
# Memory usage percentage
crowdsec_bouncer_routeros_memory_used_bytes / crowdsec_bouncer_routeros_memory_total_bytes * 100
# Average CPU load
crowdsec_bouncer_routeros_cpu_load

The bouncer reports the following to LAPI on each metrics push:

MetricDescription
active_decisionsPer-origin and per-protocol active decision counts
dropped (bytes)Delta of bytes blocked since last push, per ip_type (ipv4/ipv6)
dropped (packets)Delta of packets blocked since last push, per ip_type
processed (bytes)Delta of bytes processed (evaluated) since last push, per ip_type
processed (packets)Delta of packets processed since last push, per ip_type