Grafana 7.4 error when using expression math with elasticsearch

When I use a query math expression with two previous elasticsearch queries, like the result of query A / by the result of query B: $A/$B . Give me the following error: “expression request error”.
What is missing?
Thanks.

1 Like

can you share a screenshot of the error and any relevant logs?

Hello, I encounter the same problem. The expression $A + $B (or $A - $B) return a right result

but the expression $A / $B return a wrong value but no error.

And the expression ($A * $B) return 0.

I think thas is because of Grafana considere only “+” as a layering of these values, and don’t conside the count number as a number:

Anyway, I can’t tell to Grafana to consider only results as a count.
For information, I want to display percentage of deployments who provoked an incident (4 keys of DORA), so to display ($A / $B) * 100.

Somone have any idea ?

Thank you in advance :wink:

I am facing the same issue, +, - , * work fine for me, but the / (division).
When Min Doc Count set 0, it gave me an NaN, when set to 1, it gave me a unreasonable result.
Changing on the Interval in Date Histogram also had the similar behavior.

My Grafana version 8.0.6, Stat panel

This topic was automatically closed after 365 days. New replies are no longer allowed.