1
votes

Motivation: I wanna present graph of labels trend and not values of metrics on prometheus Grafana.

My Use case is that I have simple metric that represents job information on Jenkins: in my example I'm running ci-test , build number 100 that took 10000 ms and the result is 1 which means success:

job_information{job_name="ci-test",build_number="100",duration_millis="3803023"} 1

I wanna calculate the trend of the durations of this job and watch for peaks. for example:

job_information{job_name="ci-test",build_number="100",duration_millis="10000"} 1
job_information{job_name="ci-test",build_number="101",duration_millis="10000"} 1
job_information{job_name="ci-test",build_number="102",duration_millis="20000"} 1

the trends duration represented would be [10000,10000,20000] or in graph representation something like that: __/ We can observe the peak on 20000 - I want to present this duration graph on grafana. (The result of this test is not bothering me) - The problem is that the duration is a label and not a value. The the Graph on grafana is pointing only for values such as 0/1 and not for labels. Does anybody know how to do it with grafana?

1

1 Answers

1
votes

I suggest to use prometheus labels not as a value. Having the way you purpose will break prometheus performance sure to label cardinality. You should redesign your metrics to export the duration as a volunteer, which is the standard for prometheus metrics.

You can check for more details here: https://www.robustperception.io/cardinality-is-key