Replies: 1 comment
-
Hello, typically having a series with missing labels can cause confusion, so it might be nice if you can put in some sort of placeholder for the missing fields. That said, you can achieve this in Prometheus by setting the label value to an empty string. You will end up with an output like:
Prometheus then treats empty strings the same as if they did not exist so when you go to query the data you will get the result you expect. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to create a custom metrics for the multiple devices connected to a node and these devices sends data with different key value pairs.
Below is the sample metrics I want to create. Like in 1st metrics I have a deviceId and in the second one I have ip as there will be multiple dynamics fields which will be different in all metrics
device_status{Manufacturer="xyz",Model="abc",NW_Type="1",gateway="192.168.0.0",serial_no="12345",subnet_mask="255.255.255.0",deviceId="a1"} 1.0
device_status{Manufacturer="xyz",Model="xyz",NW_Type="1",gateway="192.168.0.1",serial_no="123",subnet_mask="255.255.255.0",ip="192.168.1.1"} 1.0
Please suggest how to create these types of dynamic metrics using prometheus python client
Beta Was this translation helpful? Give feedback.
All reactions