InfluxDB2 flux language provides a convenient way to get all the tags values for a specific bucket/measurement combination, using the schema.measurementTagValues function.
The problem is that the documentation doesn't mention how to filter this list to keep only the tag values that match a certain criteria.
Example :
With the following query, I can get all the transaction tag values :
import "influxdata/influxdb/schema"
schema.measurementTagValues(
bucket: "jmeter",
measurement: "jmeter",
tag: "transaction",
)
The schema contains another tag named "application". I want to get all the transactions for a specific application, not all of them.
How can we achieve this with flux?
The same request in InfluxQL would be pretty straightforward :
SHOW TAG VALUES FROM "jmeter" WITH KEY = "transaction" WHERE "application" = $application
The goal is to create Grafana dynamic dropdown lists like this one :
