Update the existing custom metrics

I have a metrics like this device{deviceID=“dev1”,code=“3”,status=“Connected”} 1.0 and the value of the labels like code and status changes after certain conditions then promethius inserts a new metrics for this.

Please suggest how to update the existing metrics.

device{deviceID=“dev1”,code=“3”,status=“Connected”} 1.0
device{deviceID=“dev1”,code=“4”,status=“Not Connected”} 1.0

Those are different time series. When you have enums like that the best idea is to always return all the different options, but with only one haveing the value of 1 (and 0 for the others).

So for example:

device{status=“Connected”} 1
device{status=“Not Connected”} 0
device{status=“Broken”} 0

Which might then change to

device{status=“Connected”} 0
device{status=“Not Connected”} 0
device{status=“Broken”} 1

Hi Stuart,

Basically there are multiple devices and each will have the IP address, code, status like few more labels whose value changes with certain conditions.

And we have to show the count and the status in the grafana.

Unable to find the way to reset/update the metrics whose value changes.