Using a variable in Elasticsearch percentiles "values" field

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

9.5.13 – Yes, I know that 10 is out, but I have a hunch that won’t change much. :slight_smile:

  • What are you trying to achieve?

When using an ES datasource for Percentiles, “Values” is pre-populated with what appears to be a comma-separated list. I want to use one or several values from a variable.

  • How are you trying to achieve it?

I put that sort of comma-separated list into a variable and reference it in this field.

  • What happened?

The query fails and can not be inspected through the query inspector. Several variable formatting options didn’t help.

  • What did you expect to happen?

Achieve the same as if I had entered the percentiles in the form myself.

I know that this doesn’t go done to the bottom. I was wondering whether this is a bug or if I’m stupid. I would argue that “wrong” input should lead to a situation that can still be debugged easily. When I looked at the original working query, I think I saw that it is converted into [“25”, “50”, …] for the request. This sort of magic apparently is not something I can circumvent.

Take a look at this thread

You can do a bit more fancier stuff using infinity plugin with es enpoint. Maybe this can help?