schema.measurementTagKeys() function
The schema.measurementTagKeys()
function returns a list of tag keys for a specific measurement.
The return value is always a single table with a single column, _value
.
import "influxdata/influxdb/schema"
schema.measurementTagKeys(
bucket: "example-bucket",
measurement: "cpu",
)
Deleted tags
Tags explicitly deleted from InfluxDB do not appear in results.
Expired tags
- InfluxDB Cloud: tags associated with points outside of the bucket’s retention policy may appear in results up to an hour after expiring.
- InfluxDB OSS: tags associated with points outside of the bucket’s retention policy may appear in results. For more information, see Data retention in InfluxDB OSS.
Parameters
bucket
Bucket to return tag keys from for a specific measurement.
measurement
Measurement to return tag keys from.
start
Earliest time to include in results.
Default is -30d
.
Relative start times are defined using negative durations. Negative durations are relative to now. Absolute start times are defined using time values.
stop
Latest time to include in results.
Default is now()
.
The stop
time is exclusive, meaning values with a time equal to stop time are
excluded from results.
Relative start times are defined using negative durations.
Negative durations are relative to now()
.
Absolute start times are defined using time values.
Examples
Return all tag keys in a measurement
import "influxdata/influxdb/schema"
schema.measurementTagKeys(bucket: "example-bucket", measurement: "example-measurement")
Return all tag keys in a measurement during a non-default time range
import "influxdata/influxdb/schema"
schema.measurementTagKeys(bucket: "example-bucket", measurement: "example-measurement", start: -90d, stop: -60d)
Not supported in the Flux REPL
schema
functions can retrieve schema information when executed within
the context of InfluxDB, but not from the Flux REPL.
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, the following resources are available:
InfluxDB Cloud customers can contact InfluxData Support.