Delta function fails when range is below 16m

  • What Grafana version and what operating system are you using?

v8.4.3

  • What are you trying to achieve?

We have this metric to extract the number of errors of several contexts/jobs:

idelta(org_apache_camel_FailuresHandled{type="routes", route=~"\"(R03_invoke).*", context=~".*b-ibs.*"}[5m])

This metrics works well every time in Prometheus but when it runs in Grafana fails(result is 0) if the range of time is below to 16 min

  • How are you trying to achieve it?

Executing the same function in Grafana and Prometheus

  • What happened?

The value is different when we run the query in Prometheus and Grafana. Prometheus shows a value very much higher than 0 and Grafana shows 0 or gives a error

  • What did you expect to happen?

The same value in both platforms

  • Can you copy/paste the configuration(s) that you are having problems with?

Query: idelta(org_apache_camel_FailuresHandled{type="routes", route=~"\"(R03_invoke).*", context=~".*b-ibs.*"}[5m])

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

Grafana shows this error"Metric org_apache_camel_FailuresHandled is a counter. Try applying a rate() function"

  • Did you follow any online instructions? If so, what is the URL?

No

I attached the screenshots with the values in grafana, Prometheus and also the error: