grafana
grafana copied to clipboard
InfluxDB: Support cardinality queries with backend mode
What is this feature?
Support of CARDINALITY
queries in influxql backend mode. Before this, we parse the result of those queries as usual no-time-column query like show tag values
, show tag keys
. But cardinality query response has only one value not multiple. That was causing having no value when they were queries via template variable editor. That wasn't the case for frontend mode. This PR is fixing this edge case.
Yes, that sounds confusing enough. Steps to reproduce it:
- Spin up dev environment with influxDb and influxql
- Have a dashboard and create a template variable with InfluxDB 2.x
- Use query:
SHOW TAG VALUES CARDINALITY with key = "name"
- Observe you get no value back.
- Create a dashboard panel and switch to the code mode
- Paste the same query and run it.
- Use Format as
Table
orTime Series
- You'll get data back
- Use Format as
- Switch to this branch. Try all those again and see template variables are working.
- To be extra sure, turn off backend mode
influxdbBackendMigration=false
and try all those without switching to this branch. The end result will be the same.
Who is this feature for?
InfluxDB influxql users
This PR must be merged before a backport PR will be created.