kpetremann / mqtt-exporter

Simple generic MQTT Prometheus exporter for IoT working out of the box
https://hub.docker.com/r/kpetrem/mqtt-exporter
MIT License
108 stars 30 forks source link

Now exposing a counter of received messages #5

Closed zubairov closed 3 years ago

zubairov commented 3 years ago

Could be useful to see which sensors are sending data and which are not (e.g. when outside of range)

kpetremann commented 3 years ago

FYI you can do a similar thing with existing metrics, like this:

name: sensor_no_fresh_data
expr: changes(zigbee_temperature[4h]) == 0
for: 15m
labels:
  severity: notification-daily
annotations:
  description: Sensor data did not change for 4 hours: {{ $labels.sensor }}
  sumary: No fresh data (> 4h) for {{ $labels.sensor }}

assuming the sensor is always sending different values.