0

I am trying to create a panel that shows the n'th percentile request time using the Prometheus function histogram_quantile(). I have a text box variable on the Grafana dashboard that the user will enter a floating point value in. I want to use this variable as the input to histogram_quantile

My current query is

histogram_quantile($quantile, 
   sum(rate( request_duration_seconds_bucket[2m])) by (le))

However I get an error" : "1:20: parse error: unexpected character: '$'"

Is it possible to use a grafana variable as input for a prometheus function?

Trace L
  • 27
  • 5
  • Related to this question, however in the linked question the query appears to be accepted, it is the variable content that cannot be parsed https://stackoverflow.com/questions/51776726/grafana-multivalue-float-histogram-quantile – Trace L Dec 14 '22 at 20:12

1 Answers1

1

Yes, it is possible to use dashboard variable as input for a prometheus function.

You have some error in your case. Blind guess: you have a typo in the variable name, so it is not interpreted - use query inspector to verify that variable was replaced with the correct value.

Try also to save dashboard and then refresh dashboard with browser refresh (F5).

Jan Garaj
  • 25,598
  • 3
  • 38
  • 59