You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, in practice this does not seem to work when using the Amazon Athena data source.
To showcase this, see below:
The query I am using
I am using below query:
SELECT
deviceid AS __value,
metaname AS __text
FROM
tbl_aggregations_devicemeta
Using query in regular panel
As evident, the query returns the expected results as two separate columns:
Using query in Grafana variable
Below is the result when using this query in a Grafana variable. As evident, the query returns the values (instead of the keys) for the dropdown. Futher, only the values are returned when fetching the value of the dropdown as well - it's not possible either to explicitly extract the metaname keys by using the :text modifier.
This is a very basic requirement for dynamic Variable dropdowns, so it would be great to have a fix for this.
What did you expect to happen?
I expected the Grafana Variable query to create a dropdown showing the metaname keys and that when I reference this Variable in my queries, I would get the deviceid values.
Did this work before?
No, we reported this as a bug in an older issue, grafana/grafana#30012, but that issue was closed.
How do we reproduce it?
It should be easy to reproduce by creating a simple key/value table and using Amazon Athena to query this within the Variable section.
Is the bug inside a dashboard panel?
No, it is inside the Variable section.
Environment (with versions)?
Grafana: latest cloud version
OS: Windows 10
Browser: Chrome
Grafana platform?
I use Grafana Cloud
Datasource(s)?
Athena
The text was updated successfully, but these errors were encountered:
What happened?
We are trying to use the Athena data source to load data from a simple table consisting of
metaname
(key) anddeviceid
(value).As described in below articles, it should be possible (and simple) to extract these for use in a Variable dropdown as key-value pairs:
grafana/grafana#30012
https://grafana.com/blog/2019/07/17/ask-us-anything-how-to-alias-dashboard-variables-in-grafana-in-sql/
However, in practice this does not seem to work when using the Amazon Athena data source.
To showcase this, see below:
The query I am using
I am using below query:
Using query in regular panel

As evident, the query returns the expected results as two separate columns:
Using query in Grafana variable
Below is the result when using this query in a Grafana variable. As evident, the query returns the values (instead of the keys) for the dropdown. Futher, only the values are returned when fetching the value of the dropdown as well - it's not possible either to explicitly extract the
metaname
keys by using the:text
modifier.This is a very basic requirement for dynamic Variable dropdowns, so it would be great to have a fix for this.
What did you expect to happen?
I expected the Grafana Variable query to create a dropdown showing the
metaname
keys and that when I reference this Variable in my queries, I would get thedeviceid
values.Did this work before?
No, we reported this as a bug in an older issue, grafana/grafana#30012, but that issue was closed.
How do we reproduce it?
It should be easy to reproduce by creating a simple key/value table and using Amazon Athena to query this within the Variable section.
Is the bug inside a dashboard panel?
No, it is inside the Variable section.
Environment (with versions)?
Grafana: latest cloud version
OS: Windows 10
Browser: Chrome
Grafana platform?
I use Grafana Cloud
Datasource(s)?
Athena
The text was updated successfully, but these errors were encountered: