SONiC Prometheus Exporter: High-Performance Network Observability with AsterNOS
1. Evolution of Digital Network Operations and Monitoring Challenges
Against the backdrop of high-density endpoint access and multi-service convergence in enterprise campus networks, network operations and maintenance (O&M) standards have shifted from basic connectivity to fine-grained, service-level observability. However, traditional SNMP polling faces significant challenges in modern network architectures. Its low collection frequency and coarse data granularity limit visibility. Frequent MIB tree traversal under large-scale concurrent requests can also significantly increase switch CPU utilization.
AsterNOS deeply integrates the standard SONiC monitoring architecture. Through direct access to the local in-memory database, it converts hardware status, port traffic, PoE power delivery, IP SLA link quality, and PTP metrics into standard time-series data that Prometheus can consume. This provides the underlying support for lightweight and efficient campus network O&M automation, including closed-loop fault detection, recovery, and self-healing.
2. Architecture and Core Mechanisms of Prometheus Exporter on SONiC
2.1 Data Presentation Architecture
Exporter: The dedicated data adapter on an AsterNOS switch, responsible for data collection. It converts metrics from different internal targets into a standard data format that Prometheus can understand. The Exporter runs as an independent Docker container on the device being monitored and exposes an HTTP endpoint (http://localhost:9100/metrics). Prometheus periodically scrapes data from this endpoint.
Prometheus: The central data store and monitoring engine of the system, responsible for pulling and storing metrics. It actively and periodically scrapes data from the endpoints exposed by each Exporter and stores the data in its built-in time series database (TSDB) for efficient management. Once the Exporter addresses are defined in the Prometheus configuration file, Prometheus automatically starts collecting and storing the time series data.
Grafana: The final presentation layer of the monitoring system, responsible for data visualization. It presents the large volume of data stored in Prometheus through clear and intuitive charts or tables. Grafana does not store data itself. It provides an interface for querying and visualizing data. Prometheus can be added as a data source, and PromQL queries can then be used to turn the relevant data into real-time, interactive dashboards.
2.2 Core Mechanisms of Prometheus Exporter
Unlike traditional monitoring methods that rely on protocol stack translation, the Exporter uses direct access to the local in-memory database, bypassing complex protocol conversion.
Traditional switch monitoring, such as SNMP-based monitoring or external MIB collection, requires multiple protocol layers for data encapsulation and translation. AsterNOS Exporter takes advantage of the database-centric architecture of SONiC. It connects directly to the switch’s local in-memory databases for fast metric collection.
- Local Loopback Connection (Go-Redis Client): The Exporter runs as an independent Docker container on the switch. It connects to the local Redis in-memory database through 127.0.0.1:6379.
- Direct Access to Multiple Database Instances: During operation, internal switch components write real-time status information to different Redis database instances. When the Exporter receives a Pull request from Prometheus, it queries the corresponding local database directly:
STATEDB: Reads protocol runtime and hardware status.
COUNTERSDB: Reads interface packet counters that change frequently.
CONFIGDB: Reads device configuration information.
3. Monitoring Capability Matrix
| Module | Metrics Collected |
|---|---|
| General | Device Info |
| General | FAN RPM |
| General | Device Up Time |
| General | CPU Usage |
| General | Memory Usage |
| General | Sensor's Tempt |
| General | Sensor's Tempt Threshold |
| General | PSU Input Current |
| General | PSU Output Current |
| General | PSU Input Volts |
| General | PSU Output Volts |
| General | PSU Input Power |
| General | PSU Output Power |
| MCLAG | Mclag Domain Operational Status |
| MCLAG | MCLAG State Info |
| Network Time Protocol (NTP) | NTP Sync Status |
| Network Time Protocol (NTP) | NTP Jitter- Mean deviation in times between the switch and the NTP server |
| Network Time Protocol (NTP) | Round-trip delay to the NTP server |
| Network Time Protocol (NTP) | NTP Global |
| NTP Global | NTP Offset- Time difference between the switch and the NTP server |
| NTP Global | Time since last synchronized |
| Digital Optical Monitoring (DOM) | Transceiver Info |
| Digital Optical Monitoring (DOM) | DOM Optic Tx Power |
| Digital Optical Monitoring (DOM) | DOM Optic Rx Power |
| Digital Optical Monitoring (DOM) | DOM Optic Tempt |
| Digital Optical Monitoring (DOM) | DOM Optic Voltage |
| Digital Optical Monitoring (DOM) | DOM Bias Ampere |
| Critical Resource Monitoring (CRM) | CRM STATS |
| Interface | Interface Info |
| Interface | Time since last flap of interface |
| Interface | Interface Tx Packets |
| Interface | Interface Rx Packets |
| Interface | Interface Tx Bytes |
| Interface | Interface Rx Bytes |
| Interface | Interface Tx Buffer Drop Packets |
| Interface | Interface Rx Buffer Drop Packets |
| Interface | Interface Tx Drop Packets |
| Interface | Interface Rx Drop Packets |
| Interface | Interface Tx error packet |
| Interface | Interface Rx error packet |
| Interface | Packets received on Ethernet |
| Interface | Size of the Ethernet Frames transmitted |
| Interface | Interface queue transmitted packets |
| Interface | Interface queue transmitted bytes |
| Interface | Interface egress queue dropped packets |
| Interface | Interface egress queue dropped bytes |
| Interface | Interface PoE Current (Amps) |
| Interface | Interface PoE Voltage (Volts) |
| Interface | PoE Power (Watts) |
| Vlan | Vlan Tx Packets |
| Vlan | Vlan Rx Packets |
| Vlan | Vlan Tx Bytes |
| Vlan | Vlan Rx Bytes |
| Vlan | Vlan Information |
| ACL | ACL Table Info |
| ACL | ACL Rule Info |
| ACL | ACL Packets |
| ACL | ACL Bytes |
| Static Anycast Gateway | SAG Info |
| Static Anycast Gateway | SAG Admin Status |
| Static Anycast Gateway | SAG Operational Status |
| BGP | BGP Status |
| BGP | BGP Peer Uptime |
| BGP | BGP Messages Tx from Peers |
| BGP | BGP Messages Rx by Peers |
| BGP | Total BGP Prefixes Tx from Peers |
| BGP | Total BGP Prefixes Rx by Peers |
| OSPF | OSPF Status |
| OSPF | OSPF Neighbor Uptime |
| OSPF | OSPF Neighbor RetxCounter |
| OSPF | OSPF Neighbor Request Counter |
| OSPF | OSPF Neighbor DBSummaryCount |
| EVPN | Status of the EVPN Endpoints |
| EVPN | Remote Vteps Operational Status |
| EVPN | Number of remote VTEPs associated with VNI |
| EVPN | Number of ARPs cached for the VNI |
| EVPN | Number of L2 vnis associated with an L3 VNI |
| EVPN | Number of Mac Addresses learned VNI |
| SLA | Track Table |
| SLA | Route Tack table |
| SLA | Sla table |
| PTP | PTP Offset to Master |
| PTP | PTP Path Delay |
| PTP | PTP Instance Information |
| PTP | PTP Port Information |
| PTP | PTP sm_tlv Information |
| PTP | PTP Gnss Information |
4. Example Application Scenarios
Enterprise campus networks typically feature high-density endpoint access, redundant routing across multiple service gateways, and stringent time synchronization requirements in specific scenarios. By directly accessing the local Redis in-memory database, the Exporter enables end-to-end observability across multiple services, covering the physical layer, data link layer, routing layer, security policy layer, and high-precision time synchronization.
Grafana dashboard section list:
Device Status:
Link Status:
Protocol Status:
Ready to Implement?
Explore our detailed implementation guides to turn these white paper insights into real-world networking solutions. From RoCE to Zero-Touch Provisioning, we’ve got you covered.