Event-Driven MDT
Configure MDT as follows:
telemetry model-driven
destination-group TIG
address-family ipv4 10.100.100.1 port 57500
encoding self-describing-gpb
protocol grpc no-tls
!
!
sensor-group SENSOR1
sensor-path Cisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface[interface-name="GigabitEthernet0/0/0/0.100"]/latest/generic-counters
!
subscription SUB1
destination-id TIG
Use event-driven MDT so that data is only sent to the collector upon a change.
Use the following query in Grafana:
from(bucket: "telemetry")
|> range(start: v.timeRangeStart, stop:v.timeRangeStop)
|> filter(fn: (r) =>
r._measurement == "Cisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-counters" and
r._field == "bytes_sent"
)
Answer
telemetry model-driven
include select-leaves-on-events
!
subscription SUB1
sensor-group-id SENSOR1 sample-interval 0
Explanation
Event-driven telemetry can be more optimal than timer-based MDT. With event-drive telemetry, data is only sent to the collector upon a change.
There seems to be a limited number of sensor-paths that can use event-driven telemetry. For example, I first tried to do this with the previous ISIS RIB path, but it didn’t work. I found this slide which appears to indicate that it only works for certain paths.

To configure event-driven telemetry, you simply set the sample-interval to 0.
telemetry model-driven
subscription SUB1
sensor-group-id SENSOR1 sample-interval 0
We also have the below optional knob:
telemetry model-driven
include select-leaves-on-events
This appears to mean that only when the configured leaves in the sensor path have a change (i.e. Gi0/0/0/0.100), the data will stream. Not when any leaf in the path has a change.
The documentation also now differentiates between timer-based and event-based streaming by calling timer-based streaming “candence-driven telemetry.”
Note that I was not able to get this to work reliably. Perhaps it is a limitation with XRv9K and XRd. I only got one data point when I committed the config, and nothing else. Later I added the “include” knob and got another data point, but again nothing else after that.
Last updated