Graphing min and max horizontal lines for selected time

I need to create horizontal lines representing min and max values for a selected period on a time-series panel. The data source is Prometheus.

At the moment I end up with 3 queries like so

Metric:

sum by(process) (windows_process_working_set_bytes{process="MyProcess"})

Max

max_over_time(sum by(process) (windows_process_working_set_bytes{process="MyProcess"})[${__range}:])

Min

min_over_time(sum by(process) (windows_process_working_set_bytes{process="MyProcess"})[${__range}:])

But it does produce a sort of floating graph of max and min values calculated from out of selected time rather than horizontal lines sitting on the peak and the bottom of metric graph.

Grafana v12.2.1

Use thresholds - show them as lines and define threshold(s) with transformation, which will get value from your query. Example:

2 Likes

Tried that. The snag is that you can define only one threshold with config transformation.
At the moment I end up with relevant thresholds of 0% and 100%.
That works good but then you can’t have absolute thresholds.

Thanks for your help.