Free tech learning for everyone, from basics to pro

Network AutomationNetworking SecurityIntermediate

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.

Getting data from devicesSNMP pollingCollector asks every few minutesMIBs, countersMisses short spikesOlder, widely supportedStreaming telemetryDevice pushes dataYANG pathsSeconds or on changeModern platforms
Figure 1. Telemetry gives faster, richer data, which automation and monitoring both rely on.

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/counters from 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?
gRPC, which runs over HTTP/2 with TLS.
What is the difference between sample and on-change subscriptions?
Sample sends data at fixed intervals; on-change sends data only when a value changes.
Name a typical collector, database and dashboard for telemetry.
For example gnmic or Telegraf, Prometheus or InfluxDB, and Grafana.

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.
Tracks your learning on this device only. See your progress on the learning paths.
Verified author✓ Valid
Issued to
Mohamed Fayas
Role
Founder of FM TecHub
Credentials
CCNABTEC HND Network EngineeringBEng (Hons) Computer Networking & Cloud Security
Issuer
FM TecHub · fmtechub.com

He writes practical, plain-English guides on networking, security and cloud.

More about the author →

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.

Email updates: coming soon

New notes, tools and security news from FM TecHub by email, explained simply. Free. We're not collecting email addresses yet; see our privacy policy.

PortServiceStatus
SMTP/25Email updatesopening soon

Meanwhile, stay connected: