Count missing data for metric with label

44 views
Skip to first unread message

Yaron B

unread,
Aug 16, 2021, 5:19:33 AM8/16/21
to Prometheus Users
Hello, I have a metric that checks the lag of a consumer group.
 from time to time, the metric is missing for a specific label, as shown in the image attached.

I would like to get a graph that counts whenever there is a missing data point.
for example , for the image attached I would like to get 0 until 
6:50,
then 1 until 7:50, 0 again until 8:05, and then 1 until 8:58

is there a way to write a query to this metric to get the graph that I need?

thanks!
Screen Shot 2021-08-16 at 12.16.28.png

Yaron B

unread,
Aug 16, 2021, 5:41:11 AM8/16/21
to Prometheus Users
ok got it, ignore the dollar sign, its from grafana
count(sum(kafka_consumergroup_lag{consumergroup="$consumergroup"}) by (consumergroup)) -1 or on() vector(1)

ב-יום שני, 16 באוגוסט 2021 בשעה 12:19:33 UTC+3, ‪Yaron B‬‏ כתב/ה:
Reply all
Reply to author
Forward
0 new messages