Problem with dynamic thresholds colors + config from Query transformation

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

  • What are you trying to achieve?
    I have a line graph and a dynamic threshold, I want to have the line colored in red UNDER the threshold (and green when it’s over the threshold).

  • How are you trying to achieve it?
    I used “Config from Query” and defined the threshold. So far, so good.
    Then I tried to change the threshold color, but that does not work as I thought, even when I modify the base color for threshold (right pane)

  • What happened?
    It only changes the color OVER the threshold, the color UNDER the threshold seems to be green by default.

  • What did you expect to happen?
    I expected to be able to change the base color (ie UNDER the threshold) to a different color than green.

  • Did you follow any online instructions? If so, what is the URL?
    I found a GitHub issue mentioning such a problem, but it was closed because it is supposed to work on v11. Am I missing something?

what is your datasource

Timestream, but I expect the behavior to be the same whatever the datasource

depends. depends if you are using transformations or you set things up in the datasource itself.

for example in sql server I would use

CASE 
    WHEN foo < bar THEN 1 
--you would use this in key value pairs to color things the way you want them
     ELSE 0 as threshold 
END

I think I see what you’re suggesting. With Timestream I’m able to compute this threshold_exceeded boolean for each data point, but I fail to see how to use it afterwards to make it so the line graph changes color according to its relative position to the threshold… :thinking:

If that works, I’m more than eager to use it, however I still feel like it would be more or less some kind of workaround for a lacking feature in the “config from Query” transformation (provided I did not oversee anything)

oh you want the actual line color to change from 80 down?

Yes, something like that but with the colors switched (working with FPY, so the higher the better) :

No one to confirm whether the problem still persists for Grafana v11?

Sir, have you solved this issue? I’m currently having the same problem. The root-cause of the problem are two things:

  • Grafana automatically sets the base threshold color as GREEN when using the “Config from query” transformation.
  • Grafana doesn’t allow you to set multiple thresholds in a “Config from query” transformation.
    Kind regards,

Hi @leandrofavaretto26
Unfortunately, I haven’t found any workaround for the moment.
Still interested in it, if anyone has anything to share on the topic…