Streaming telemetry with gNMI: subscribing to YANG data instead of polling SNMP
In short: Streaming telemetry lets network devices push data to collectors instead of being polled. With gNMI over gRPC, a collector subscribes to YANG paths such as interface counters and receives updates every few seconds or whenever a value changes. Tools such as gnmic and Telegraf collect the data into time-series databases for dashboards and automation.
Why move beyond SNMP?
SNMP polling every five minutes misses short bursts of congestion, puts load on device CPUs when many collectors poll, and relies on MIBs that vary by vendor. Model-driven telemetry streams structured data defined by YANG models, quickly and efficiently.
Key concepts
- gNMI (gRPC Network Management Interface): an OpenConfig specification that runs over gRPC (HTTP/2 with TLS) for getting, setting and subscribing to data.
- YANG paths: such as
/interfaces/interface[name=Ethernet1]/state/countersfrom OpenConfig models, or vendor native models. - Subscription modes: sample (send every N seconds) and on-change (send when a value changes, ideal for interface status or BGP neighbour state).
- Dial-in: the collector connects to the device and subscribes. Dial-out: the device connects to the collector based on its configuration.
A simple example with gnmic
gnmic -a 10.0.0.1:57400 -u admin -p 'secret' --skip-verify \
subscribe --path "/interfaces/interface/state/counters" \
--mode stream --stream-mode sample --sample-interval 10s
This streams interface counters every 10 seconds. In production, use proper TLS certificates instead of --skip-verify, and store credentials securely.
Building a pipeline
- Collector: gnmic or Telegraf with its gNMI input plugin.
- Storage: a time-series database such as Prometheus or InfluxDB.
- Visualisation and alerts: Grafana dashboards and alert rules.
- Automation: alerts can trigger scripts or event-driven automation.
Practical tips
- Enable gNMI on devices (for example Arista EOS, Cisco IOS XR and NX-OS, Juniper Junos, Nokia SR Linux, and Cisco IOS XE with its gNMI or model-driven telemetry features). Check platform support and configuration.
- Start with a few useful paths: interface counters and status, CPU and memory, BGP neighbours, optics levels.
- Choose sample intervals carefully; 10 to 30 seconds is often plenty, and on-change for state.
- Restrict access to the telemetry port and use TLS with certificates.
Real-world example: microbursts found
A trading firm saw packet drops on a switch but five-minute SNMP graphs showed only 30 percent utilisation. Streaming interface counters every second via gNMI revealed bursts reaching 100 percent for under a second, filling buffers. The firm changed queue configuration and spread traffic, ending the drops.
Practice
What transport does gNMI use?
What is the difference between sample and on-change subscriptions?
Name a typical collector, database and dashboard for telemetry.
Key takeaways
- Streaming telemetry pushes structured data from devices instead of polling.
- gNMI over gRPC subscribes to YANG paths with sample or on-change modes.
- Collectors feed time-series databases and dashboards.
- Start with key paths, sensible intervals and secure TLS.
Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.