Passing dictionary as labels in python - prometheus #713
-
gdiskc = Gauge("disk_usage_c_drive", "Disk Usage C Drive", disk_usageC.keys()) def set_calc_(): Metrics looks like this: I need to get rid of the 0.0 in disk_usage_c_drive gauge as my graph is grafana is 0. I'm trying to write windows exporter in python. please help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello, I converted this from an issue to a discussion as it appears to be a usage question. You should not be including the value of a metric as labels such as in your example. Every time your disk usage changes right now Prometheus will create a new series which will be very expensive and hard to use. Typically you will want multiple metrics each with the value. For example:
Does that help? You can take a look at some of the metrics in the windows exporter to get an idea: https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.logical_disk.md. |
Beta Was this translation helpful? Give feedback.
Hello, I converted this from an issue to a discussion as it appears to be a usage question.
You should not be including the value of a metric as labels such as in your example. Every time your disk usage changes right now Prometheus will create a new series which will be very expensive and hard to use. Typically you will want multiple metrics each with the value. For example:
Does that help? You can take a look at some of the metrics in the windows exporter to get an idea: https://github.com/prometheus-community/wi…