Skip to content

Commit f9f1525

Browse files
committed
feat(metrics): add temperature, error and scrape duration metrics
1 parent 7dfe01b commit f9f1525

4 files changed

Lines changed: 625 additions & 3 deletions

File tree

docs/usage/metrics.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ These require custom logic (cross-database joins, aggregate counting, error fall
3434
| `sonic_switch_interface_admin_state` | gauge | `interface` | Admin state (1=up, 0=down) |
3535
| `sonic_switch_interfaces_total` | gauge | `operational_status` | Number of interfaces by status |
3636
| `sonic_switch_ports_total` | gauge || Total physical ports |
37+
| `sonic_scrape_duration_seconds` | gauge || Duration of the last metrics scrape |
3738

3839
### Config-driven collectors
3940

@@ -52,9 +53,17 @@ These are defined in YAML and can be customized or extended by operators. The de
5253
| `sonic_switch_interface_neighbor_info` | gauge | `interface`, `neighbor_mac`, `neighbor_name`, `neighbor_port` | LLDP neighbor metadata, always 1 |
5354
| `sonic_switch_temperature_celsius` | gauge | `sensor` | Chassis temperature sensor reading |
5455
| `sonic_switch_temperature_high_threshold_celsius` | gauge | `sensor` | Chassis temperature sensor high threshold |
56+
| `sonic_switch_temperature_warning` | gauge | `sensor` | Chassis temperature warning status (1=warning, 0=ok) |
57+
| `sonic_switch_interface_bytes_total` | counter | `interface`, `direction` | Bytes transferred |
58+
| `sonic_switch_interface_packets_total` | counter | `interface`, `direction`, `type` | Packets by type (unicast, multicast, broadcast, non_unicast) |
5559
| `sonic_switch_interface_errors_total` | counter | `interface`, `direction` | Interface error counters |
5660
| `sonic_switch_interface_discards_total` | counter | `interface`, `direction` | Interface discard counters |
57-
| `sonic_switch_interface_fec_frames_total` | counter | `interface`, `type` | FEC frame counters |
61+
| `sonic_switch_interface_dropped_packets_total` | counter | `interface`, `direction` | SAI-level dropped packets |
62+
| `sonic_switch_interface_fec_frames_total` | counter | `interface`, `type` | FEC frame counters (correctable, uncorrectable, symbol_errors) |
63+
| `sonic_switch_interface_queue_length` | gauge | `interface` | Current output queue length |
64+
| `sonic_switch_interface_pfc_packets_total` | counter | `interface`, `direction`, `priority` | PFC packets per priority (0-7) |
65+
| `sonic_switch_interface_packet_size_total` | counter | `interface`, `direction`, `size` | Packets by size bucket |
66+
| `sonic_switch_interface_anomaly_packets_total` | counter | `interface`, `type` | Anomalous packets (undersize, oversize, fragments, jabbers, unknown_protos) |
5867

5968
## Metrics configuration schema
6069

0 commit comments

Comments
 (0)