Different labels for the same metric

16 views
Skip to first unread message

Steven Swann

unread,
Sep 29, 2020, 4:52:25 AM9/29/20
to Prometheus Users

I'm trying to create a metric that monitors NIC status of the various interfaces on a given host. I've read the naming and label rules, and as I understand it, I should have a single Emum metric, such as, "NIC_operstates" and then add a label for each of the different interfaces, "eth0", "eth1"... Does that sound right? I started with creating a metric for each interface, so "eth0_operstate", but I believe this is incorrect based on the naming and label conventions.

So my question is. In a single script, how can I create a single metric, that provides multiple network interface status with different labels. I'm using the prometheus/client_python library. Is this possible? If I create a single metric, how can I give each call of state() - to update the metric - a different label? Or have I got this completely wrong?

Many thanks

Reply all
Reply to author
Forward
0 new messages