smlx / goodwe-exporters

Prometheus Exporters for Goodwe Energy Monitors (smart meters) and Solar Inverters
Apache License 2.0
13 stars 0 forks source link

Delete labels after no metrics for 2 minutes #26

Open smlx opened 10 months ago

smlx commented 10 months ago

Inverters are powered from the PV array, so they stop sending metrics at night. When this happens, prometheus will scrape the last value seen before the inverter went offline all night until the sun comes up and the inverter comes back online.

Metrics packets are sent every minute, so after two minutes assume the device has gone offline and delete the labels from the metrics vec.