I want to create a variable threshold

I want to create a variable threshold

Hello everyone
Despite reading numerous topics on the subject, such as this one Thresholds Dynamic in Graphic Time Series - #3 by grant2, I haven’t managed to achieve my goal.

I want to create a dynamic threshold on a Time Series graph. Instinctively, I created a variable with a Flux query:

from(bucket: "GIN")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "°C")
  |> filter(fn: (r) => r["_field"] == "DJChauf")
  |> mean(column: "_value")

Then I tried to insert it into the threshold module. But it doesn’t work.

I’d like to create a threshold line that changes depending on the window, since the average will change depending on the query.

I also have another problem with the query mentioned above.
Grafana returns

Data is missing a time field

Whereas Influx gives the average

Grafana version : v10.2.3
InfluxDB version : v2.7.4

Thank in advance.



Your keyword to search is Transformation Config from query results

I’ve done a lot of research and read a lot of topics on this subject but I haven’t succeeded.

So be specific what, how did you try and what is not working. Please don’t expect that you will say “it is not working” and someone will spend hour to write step by step guide just for your case. You should to define what you have tried first (reproducible example) and then you will have higher chance for proper answer/advice.

I want to create a dynamic threshold.

This threshold takes into account the average of values over the period defined by the dashboard.

I’d like this value to be included in a time series panel to display a line like the fixed thresholds already definable.