Elasticsearch - Multi query frame name

I am working with an elasticsearch data source.
I would like to both split by one field and group by another field.

The group by field has a very high cardinality over time so I cannot use the default group by by I can use a transformation to group by.

My problem is that to achieve the split I am currently doing multiple queries, only the frames are named 1, 2, 3, 4 and so on.

This means if query 2 does not return data the queries are reordered numerically. More importantly when I visualize the data the legend reads:

  • blah 1 (mean) - blah 2 (mean) blah 3 (mean)
    Which is not very descriptive. If I do an outer join I can organize and then rename the key fields, but due to the fact I may not always get the same data and the fields can be renumbered that doesn’t really work.

Ideally I would be able to name the query and the named query would name the frame and that name would then be what gets applied to each field rather than a number. But today that does not seem possible with the existing plugin.

Is there a way to achieve this?

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

  • What are you trying to achieve?

  • How are you trying to achieve it?

  • What happened?

  • What did you expect to happen?

  • Can you copy/paste the configuration(s) that you are having problems with?

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

  • Did you follow any online instructions? If so, what is the URL?