grafana icon indicating copy to clipboard operation
grafana copied to clipboard

InfluxDB: Support cardinality queries with backend mode

Open itsmylife opened this issue 10 months ago • 1 comments

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 or Time Series
    • You'll get data back
  • 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

itsmylife avatar May 02 '24 17:05 itsmylife

This PR must be merged before a backport PR will be created.