'SHOW SERIES CARDINALITY' in InfluxDB v2

@0liver The influxdb.cardinality() function depends on an API that hasn’t been added to InfluxDB 2.0 yet. In the mean time, you can use a query similar to the following to return the total series cardinality within a time range. Fair warning, this could be a fairly heavy query depending on your data.

By default, from() returns results grouped by series (measurement, tag set, and field key). The example below uses first() to limit each table (series) to a single row, and then group() to group all rows into a single table, and then count() to count the number of rows in the table. That should give you series cardinality.

from(bucket: "example-bucket")
  |> range(start: -1y)
  |> first()
  |> group()
  |> count()
1 Like