Skip to content

Passing dictionary as labels in python - prometheus #713

Answered by csmarchbanks
Yamunaindiran asked this question in Q&A
Discussion options

You must be logged in to vote

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:

disk_usage_free_bytes{drive="c"} 61112762368
disk_usage_total_bytes{drive="c"} 128849014784
disk_usage_used_bytes{drive="c"} 67736252416
disk_usage_used_ratio{drive="c"} 0.526

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…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Yamunaindiran
Comment options

Answer selected by Yamunaindiran
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #709 on October 29, 2021 14:55.