@@ -9,6 +9,7 @@ import {getTimeRangeVars} from 'src/variables/utils/getTimeRangeVars'
9
9
import { formatExpression } from 'src/variables/utils/formatExpression'
10
10
import { tagToFlux } from 'src/timeMachine/utils/queryBuilder'
11
11
import { event } from 'src/cloud/utils/reporting'
12
+ import { isFlagEnabled } from 'src/shared/utils/featureFlag'
12
13
13
14
// Types
14
15
import { TimeRange , BuilderConfig } from 'src/types'
@@ -17,6 +18,7 @@ import {pastThirtyDaysTimeRange} from 'src/shared/constants/timeRanges'
17
18
18
19
const DEFAULT_TIME_RANGE : TimeRange = pastThirtyDaysTimeRange
19
20
const DEFAULT_LIMIT = 200
21
+ const EXTENDED_LIMIT = 500
20
22
21
23
export interface FindBucketsOptions {
22
24
url : string
@@ -61,10 +63,14 @@ export function findKeys({
61
63
? ''
62
64
: `\n |> filter(fn: (r) => r._value =~ regexp.compile(v: "(?i:" + regexp.quoteMeta(v: "${ searchTerm } ") + ")"))`
63
65
66
+ const adjustedLimit = isFlagEnabled ( 'increasedMeasurmentTagLimit' )
67
+ ? EXTENDED_LIMIT
68
+ : limit
69
+
64
70
// TODO: Use the `v1.tagKeys` function from the Flux standard library once
65
71
// this issue is resolved: https://github.com/influxdata/flux/issues/1071
66
72
const query = `import "regexp"
67
-
73
+
68
74
from(bucket: "${ bucket } ")
69
75
|> range(${ timeRangeArguments } )
70
76
|> filter(fn: ${ tagFilters } )
@@ -73,7 +79,7 @@ export function findKeys({
73
79
|> distinct()${ searchFilter } ${ previousKeyFilter }
74
80
|> filter(fn: (r) => r._value != "_time" and r._value != "_start" and r._value != "_stop" and r._value != "_value")
75
81
|> sort()
76
- |> limit(n: ${ limit } )`
82
+ |> limit(n: ${ adjustedLimit } )`
77
83
78
84
event ( 'runQuery' , {
79
85
context : 'queryBuilder-findKeys' ,
0 commit comments