Update the existing custom metrics #699
Unanswered
atifsayeedi
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Hello, the typical way of doing this is by using the idea of a state set, which means you will always export both of the metrics you provided, but only one of them would be 1, and the other one would be 0. Then, when status changes you set the value of the old status to 0, and the new status to 1. The reason for this is to avoid creating very short lived series if a device is alternating between connected and not connected often. At query time, you can then use > 0 to filter to just the state at any point in time. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a metrics like this device{deviceID=“dev1”,code=“3”,status=“Connected”,ipAddress="192.180.0.0"} 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”,ipAddress="192.180.0.0"} 1.0
to
device{deviceID=“dev1”,code=“4”,status=“Not Connected”,ipAddress="192.180.0.0"} 1.0
Beta Was this translation helpful? Give feedback.
All reactions