Skip to content

Collectors

opnsense2otel runs 65 sub-collectors on independent background schedules, each targeting a specific OPNsense subsystem. Poll results are stored in memory; Prometheus scrapes replay that snapshot and make no OPNsense API calls.

Poll and replay flow

flowchart LR
    T[Per-collector timers] --> P[Scheduled collector polls]
    P --> A[OPNsense API]
    P --> S[Atomic in-memory snapshots]
    H[Independent health poll] --> A
    H --> S
    M[Prometheus /metrics request] --> R[Replay selected snapshots]
    O[OTLP metrics bridge] --> R
    S --> R
    R --> E[Emit metrics without API calls]

Auto-registration pattern

Sub-collectors register themselves via init() functions that append to a global collectorInstances slice. Adding a new collector requires only creating the file with an init() function - no manual registration is needed. See Adding a Collector for details.

Top-level exporter metrics

These metrics are always emitted regardless of which sub-collectors are enabled:

MetricTypeDescription
opnsense_upGaugeWhether the independent health poll last reached OPNsense (1 = reachable, 0 = unreachable). A reachable but degraded box stays 1; see opnsense_system_status_code
opnsense_firewall_statusGaugeFirewall health status from the stored health poll (1 = ok, 0 = errors); absent when OPNsense is unreachable
opnsense_crash_reporter_statusGaugeCrash reporter status (1 = ok/no crash reports, 0 = crash reports present); absent when OPNsense is unreachable
opnsense_system_status_codeGaugeNumeric OPNsense system status code from health check (2 = OK, 1 = NOTICE, 0 = WARNING, -1 = ERROR; OPNsense >= 25.1); absent when unreachable
opnsense_system_subsystem_status_codeGaugeNumeric SystemStatusCode for every health-check subsystem present in the response, by subsystem label (e.g. diskspace, rootlock, crashreporter, firewall, plugin overrides). OPNsense omits healthy subsystems, so a series is present only while unhealthy
opnsense_exporter_scrapes_totalCounterTotal number of /metrics snapshot replays served
opnsense_exporter_endpoint_errors_totalCounterTotal API errors by endpoint

Collector reference

Enabled by default

CollectorSubsystemDescriptionDisable flag
ARP tablearp_tableARP cache entries--exporter.disable-arp-table
GatewaysgatewaysGateway status, RTT, loss, configurationAlways enabled
InterfacesinterfacesInterface traffic counters, packet totals, queue stats, link state, line rateAlways enabled
Protocol statsprotocolCARP, pfsync, IP, TCP, ARP protocol statistics (39+ metrics)Always enabled
ServicesservicesService running status across all OPNsense servicesAlways enabled
Cron jobscronCron table entries--exporter.disable-cron-table
WireGuardwireguardWireGuard tunnels, peers, transfer stats, service status--exporter.disable-wireguard
IPsecipsecIPsec tunnels, phase1/phase2 status, service status--exporter.disable-ipsec
Unbound DNSunbound_dnsDNS resolver statistics (30+ metrics), blocklist status, service status--exporter.disable-unbound
OpenVPNopenvpnOpenVPN instances, sessions, traffic--exporter.disable-openvpn
FirewallfirewallPF interface packet/byte counters (IPv4/IPv6 pass/block), state table, per-interface hits--exporter.disable-firewall
Firewall rulesfirewall_ruleTotal rule count; opt-in per-rule detail metrics--exporter.disable-firewall-rules
FirmwarefirmwareFirmware version info, update status, reboot flags--exporter.disable-firmware
SystemsystemMemory, uptime, load averages, disk/swap usage, system info--exporter.disable-system
TemperaturetemperatureHardware temperature sensors--exporter.disable-temperature
Dnsmasq DHCPdnsmasqDHCP leases (total, by interface, reserved vs dynamic)--exporter.disable-dnsmasq
Mbuf statsmbufFreeBSD network buffers, allocation failures, sendfile stats--exporter.disable-mbuf
NTPntpNTP peer metrics (stratum, delay, offset, jitter)--exporter.disable-ntp
CertificatescertificateCertificate validity timestamps, expiry monitoring--exporter.disable-certificates
CARP/VIPcarpCARP HA status, demotion counter, per-VIP state--exporter.disable-carp
ActivityactivityCPU percentages (user/nice/system/interrupt/idle), thread counts--exporter.disable-activity
Kea DHCPkeaKea DHCPv4/v6 leases (total, by interface, reserved vs dynamic)--exporter.disable-kea
PF statspf_statsPF state table, counters, limit counters, memory limits, timeouts--exporter.disable-pf-stats
NDPndpIPv6 neighbor discovery table entries--exporter.disable-ndp
ISC DHCPv4dhcpv4ISC DHCPv4 lease metrics (silent when the legacy ISC DHCP backend is absent)--exporter.disable-dhcpv4
ACME clientacmeACME certificate renewal status and expiry (silent when os-acme-client is absent)--exporter.disable-acme
SMART disk healthsmartPer-disk SMART health, temperature, power-on hours (silent when os-smart is absent)--exporter.enable-smart
DynDNSdyndnsDynDNS (ddclient) account update status (silent when os-ddclient is absent)--exporter.disable-dyndns
Syslogsyslogsyslog-ng per-destination processed/dropped/queued/written stats, truncation, memory, events-per-second--exporter.disable-syslog
Q-FeedsqfeedsQ-Feeds threat-intel feed entries, blocked packets/bytes/addresses, license expiry (silent when os-q-feeds-connector is absent)--exporter.disable-qfeeds
TailscaletailscaleNode-local Tailscale state: service/backend status, peer counts; opt-in per-peer details (silent when os-tailscale is absent)--exporter.disable-tailscale
Firewall aliasesaliaspf alias table entry counts and global table used/limit; opt-in per-table pf counters--exporter.disable-alias

Disabled by default (opt-in)

CollectorSubsystemDescriptionEnable flag
Network diagnosticsnetwork_diagKernel netisr stats, socket counts, route counts, pfsync HA nodes--exporter.enable-network-diagnostics
NetFlownetflowNetFlow service status, per-interface cache statistics--exporter.enable-netflow

High-cardinality detail metrics

These produce one time series per item, so check the cardinality cost before enabling:

Detail optionParent collectorEnable flag
Dnsmasq per-lease detailsDnsmasq DHCP--exporter.enable-dnsmasq-details
Firewall per-rule detailsFirewall rules--exporter.enable-firewall-rules-details
Kea per-lease detailsKea DHCP--exporter.enable-kea-details
ISC DHCPv4 per-lease detailsISC DHCPv4--exporter.enable-dhcpv4-details
Tailscale per-peer detailsTailscale--exporter.enable-tailscale-peer-details
Alias per-table pf countersFirewall aliases--exporter.enable-alias-details

Cardinality impact

Each active DHCP lease or firewall rule generates multiple time series when detail metrics are enabled. On a firewall with 500 DHCP leases, enabling Dnsmasq details creates approximately 500 additional time series. Monitor your Prometheus storage after enabling.

Service running metrics

Several collectors include a service_running gauge (1 = running, 0 = stopped/disabled) for their respective services:

  • Unbound DNS: opnsense_unbound_dns_service_running
  • Dnsmasq: opnsense_dnsmasq_service_running
  • IPsec: opnsense_ipsec_service_running
  • WireGuard: opnsense_wireguard_service_running
  • Syslog: opnsense_syslog_service_running
  • Tailscale: opnsense_tailscale_service_running
  • Kea: opnsense_kea_service_running

Tailscale collector scope

The Tailscale collector is complementary to tailscale2otel, which covers control-plane/fleet data from the Tailscale API. This exporter deliberately emits only signals that exist solely on the firewall itself: per-peer rx/tx traffic as seen from this node, and local WireGuard session state derived purely from handshakes (peer_session_active, peers_with_active_session, direct-vs-DERP path for established sessions, last-handshake timestamps), plus the plugin/backend service state. The coordination-server Online flag is intentionally never parsed or exported: it is fleet data relayed to the node, not a local observation, and it lives in tailscale2otel along with peer last-seen and exit-node inventory. Per-peer metrics are opt-in via --exporter.enable-tailscale-peer-details.