usage.limits() function

The usage.limits() function is experimental and subject to change at any time. By using this function, you accept the risks of experimental functions.

The usage.limits() function returns a record containing usage limits for an InfluxDB Cloud organization.

import "experimental/usage"

    host: "",
    orgID: "",
    token: "",

View example usage limits record



InfluxDB Cloud region URL (Required if executed outside of your InfluxDB Cloud organization or region). Default is "".


InfluxDB Cloud organization ID (Required if executed outside of your InfluxDB Cloud organization or region). Default is "".


InfluxDB Cloud API token (Required if executed outside of your InfluxDB Cloud organization or region). Default is "".


Get rate limits for your InfluxDB Cloud organization
import "experimental/usage"

Get rate limits for a different InfluxDB Cloud organization
import "experimental/usage"
import "influxdata/influxdb/secrets"

token = secrets.get(key: "INFLUX_TOKEN")

usage.limits(host: "", orgID: "x000X0x0xx0X00x0", token: token)
Output organization limits in a table
import "array"
import "experimental/usage"
import "influxdata/influxdb/secrets"

token = secrets.get(key: "INFLUX_TOKEN")

limits = usage.limits(host: "", orgID: "x000X0x0xx0X00x0", token: token)

    rows: [
        {orgID: limits.orgID, limitGroup: "rate", limitName: "Read (kb/s)", limit: limits.rate.readKBs},
        {orgID: limits.orgID, limitGroup: "rate", limitName: "Concurrent Read Requests", limit: limits.rate.concurrentReadRequests},
        {orgID: limits.orgID, limitGroup: "rate", limitName: "Write (kb/s)", limit: limits.rate.writeKBs},
        {orgID: limits.orgID, limitGroup: "rate", limitName: "Concurrent Write Requests", limit: limits.rate.concurrentWriteRequests},
        {orgID: limits.orgID, limitGroup: "rate", limitName: "Cardinality", limit: limits.rate.cardinality},
        {orgID: limits.orgID, limitGroup: "bucket", limitName: "Max Buckets", limit: limits.bucket.maxBuckets},
        {orgID: limits.orgID, limitGroup: "bucket", limitName: "Max Retention Period (ns)", limit: limits.bucket.maxRetentionDuration},
        {orgID: limits.orgID, limitGroup: "task", limitName: "Max Tasks", limit: limits.task.maxTasks},
        {orgID: limits.orgID, limitGroup: "dashboard", limitName: "Max Dashboards", limit: limits.dashboard.maxDashboards},
        {orgID: limits.orgID, limitGroup: "check", limitName: "Max Checks", limit: limits.check.maxChecks},
        {orgID: limits.orgID, limitGroup: "notificationRule", limitName: "Max Notification Rules", limit: limits.notificationRule.maxNotifications},
Output current cardinality with your cardinality limit
import "experimental/usage"
import "influxdata/influxdb"

limits = usage.limits()
bucketCardinality = (bucket) => (influxdb.cardinality(bucket: bucket, start: time(v: 0))
    |> findColumn(fn: (key) => true, column: "_value"))[0]

    |> filter(fn: (r) => not =~ /^_/)
    |> map(fn: (r) => ({bucket:, Cardinality: bucketCardinality(bucket:}))
    |> sum(column: "Cardinality")
    |> map(fn: (r) => ({r with "Cardinality Limit": limits.rate.cardinality}))

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.