Grafana: How to measure duration when metric is missing or 0?

31 Views Asked by At

Hello ~ so I have a counter metric that I am trending as a rate, to indicate the number of events processed per second. The trend may have some gaps (see screenshot). The gaps could be attributed either to no events to process (quiet window) or the service is down. I'm trying to make a prom query that measures those gaps and trend them over time in a separate graph. For example in the screenshot below, trending these gaps would ideally give me a flat line (0) when data > 0, and then a spike (at the end of the gap) indicating a value of about 24 hours (in minutes) in then Y-axis for the large gap, and then towards the right a spike of 50 minutes for the smaller gap. I tried a few queries using count_over_time and sum_over_time but I haven't yet hit the nail. Any tips?

enter image description here

0

There are 0 best solutions below