Query how many times a value exceeded a threshold and display that number

Hello:

Query how many times a value exceeded a threshold and display that number. I have a time series graph and I am trying tous graph is an interface bps rate. Can someone provide any tips?

TIA.

What’s your datasource? Do you mean threshold like in an alert or just some value you want to compare your time series to? Also when you say “how many times did it exceeded” do you mean in some time (e.g. selected time range in Grafana), right?

The datasource is influx DB. It would be ideal to count an alert but the alert was not previously configured. So I just want to compare a value to a time series. And yes, in a selected time range in Grafana. To answer the question - “How many times did the interface rate exceed 1Mbps and for how long”

@snaraya Are you using Flux, InfluxQL or SQL to query to your Influx database?

In Flux, see here for some ideas to get you started.

In InfluxQL, this (plus using a Grafana transformation to count) might give you some ideas.

1 Like