Open bo0tzz opened 8 months ago
Hello @bo0tzz,
Thanks for the suggestion.
Unfortunately, last time I checked (I'll check this again in case it changed) the Python Prometheus library does not permit to remove easily a specific metric. There is a hacky way to do it, but it would require to play with the Prometheus library internals, which is risky on the long term (if the Prometheus lib dev change the internal structures/logic).
I'll think it through.
When renaming a device in zigbee2mqtt, the old device name still continues to exist in the exported metrics until mqtt-exporter is restarted, causing 'stuck' metrics. It would be nice to handle the rename message that zigbee2mqtt sends in some way to clear the old metric.