@@ -9,6 +9,7 @@ import {getTimeRangeVars} from 'src/variables/utils/getTimeRangeVars'
99import { formatExpression } from 'src/variables/utils/formatExpression'
1010import { tagToFlux } from 'src/timeMachine/utils/queryBuilder'
1111import { event } from 'src/cloud/utils/reporting'
12+ import { isFlagEnabled } from 'src/shared/utils/featureFlag'
1213
1314// Types
1415import { TimeRange , BuilderConfig } from 'src/types'
@@ -17,6 +18,7 @@ import {pastThirtyDaysTimeRange} from 'src/shared/constants/timeRanges'
1718
1819const DEFAULT_TIME_RANGE : TimeRange = pastThirtyDaysTimeRange
1920const DEFAULT_LIMIT = 200
21+ const EXTENDED_LIMIT = 500
2022
2123export interface FindBucketsOptions {
2224 url : string
@@ -61,10 +63,14 @@ export function findKeys({
6163 ? ''
6264 : `\n |> filter(fn: (r) => r._value =~ regexp.compile(v: "(?i:" + regexp.quoteMeta(v: "${ searchTerm } ") + ")"))`
6365
66+ const adjustedLimit = isFlagEnabled ( 'increasedMeasurmentTagLimit' )
67+ ? EXTENDED_LIMIT
68+ : limit
69+
6470 // TODO: Use the `v1.tagKeys` function from the Flux standard library once
6571 // this issue is resolved: https://github.com/influxdata/flux/issues/1071
6672 const query = `import "regexp"
67-
73+
6874 from(bucket: "${ bucket } ")
6975 |> range(${ timeRangeArguments } )
7076 |> filter(fn: ${ tagFilters } )
@@ -73,7 +79,7 @@ export function findKeys({
7379 |> distinct()${ searchFilter } ${ previousKeyFilter }
7480 |> filter(fn: (r) => r._value != "_time" and r._value != "_start" and r._value != "_stop" and r._value != "_value")
7581 |> sort()
76- |> limit(n: ${ limit } )`
82+ |> limit(n: ${ adjustedLimit } )`
7783
7884 event ( 'runQuery' , {
7985 context : 'queryBuilder-findKeys' ,
0 commit comments