Config from query results with multiple thresholds

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

  • What are you trying to achieve?
    I want to display 2 thresholds from 2 separate Prometheus queries. So the base color is orange, and the area between the 2 thresholds is green.

  • How are you trying to achieve it?
    Query A returns 6 time series. Query max and Query min each return 1 time series. I used two “Config from query results” transformations to apply each as a threshold.

  • What happened?
    The second transformation overrides the first one, so I only get one threshold. I found this github issue about this topic, which was closed, but the linked PR does not address the issue.

If I could combine min and max into a single query, then I think this would work with one “config from query results” transformation. Is that possible?

I tried using “merge series/tables” applied only to the min and max queries. The “Config from query results” shows “merge-max-min” as an available config query, and I can set both thresholds. But this way, the graph appears completely blank. The legend correctly shows the 6 series from query A. The table view shows query A values as all 0, which is not correct. They have values if I remove these transformations.

Checkout sql expression that you could leverage

Thanks, that’s a good idea but it causes the same problem as my last transformation approach. The SQL table view shows columns with time, min, max — that looks good. When I add one of them as a threshold, it works correctly. When I add both of them as a threshold, I get a blank graph again, and the values are all zero.