Graphing slow moving counters in grafana

421 views
Skip to first unread message

kkli...@gmail.com

unread,
Mar 24, 2017, 2:19:18 PM3/24/17
to Prometheus Users
I have several events (errors and such) that happen infrequently (say once a day or less).  I'd like to have a grafana graph that shows when these events happen, without showing the same count value all the time (ie if an event happens at 12:05 I'd like to see a bar or point at 12:05 but not a 1 at 12:06, 12:07 etc).

I cannot figure out the right combination of functions, rates and resolutions to get this to happen.  Does anyone have any advice?

Björn Rabenstein

unread,
Mar 26, 2017, 2:50:49 PM3/26/17
to kkli...@gmail.com, Prometheus Users
On 24 March 2017 at 19:19, <kkli...@gmail.com> wrote:
> I cannot figure out the right combination of functions, rates and
> resolutions to get this to happen. Does anyone have any advice?

`irate` with a range selector that safely covers the last two data
points (e.g. `irate(my_counter_total[2m])` with a 30s scrape interval)
should do the trick. It will give you a sharp peak whenever the
counter increases.

--
Björn Rabenstein, Engineer
http://soundcloud.com/brabenstein

SoundCloud Ltd. | Rheinsberger Str. 76/77, 10115 Berlin, Germany
Managing Director: Alexander Ljung | Incorporated in England & Wales
with Company No. 6343600 | Local Branch Office | AG Charlottenburg |
HRB 110657B
Reply all
Reply to author
Forward
0 new messages