-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Query: Enable promql-experimental-functions #8191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8aff32e
e5b0d3c
95f9ce6
f53f873
f85b8e7
706b3c2
194f433
38bc09c
bc3b07d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,9 +53,10 @@ import ( | |
) | ||
|
||
const ( | ||
promqlNegativeOffset = "promql-negative-offset" | ||
promqlAtModifier = "promql-at-modifier" | ||
queryPushdown = "query-pushdown" | ||
promqlNegativeOffset = "promql-negative-offset" | ||
promqlAtModifier = "promql-at-modifier" | ||
queryPushdown = "query-pushdown" | ||
promqlExperimentalFunctions = "promql-experimental-functions" | ||
) | ||
|
||
// registerQuery registers a query command. | ||
|
@@ -135,7 +136,7 @@ func registerQuery(app *extkingpin.App) { | |
|
||
activeQueryDir := cmd.Flag("query.active-query-path", "Directory to log currently active queries in the queries.active file.").Default("").String() | ||
|
||
featureList := cmd.Flag("enable-feature", "Comma separated experimental feature names to enable.The current list of features is empty.").Hidden().Default("").Strings() | ||
featureList := cmd.Flag("enable-feature", "Comma separated experimental feature names to enable. The current list of features is: promql-experimental-functions (enables experimental PromQL functions).").Hidden().Default("").Strings() | ||
|
||
enableExemplarPartialResponse := cmd.Flag("exemplar.partial-response", "Enable partial response for exemplar endpoint. --no-exemplar.partial-response for disabling."). | ||
Hidden().Default("true").Bool() | ||
|
@@ -317,6 +318,7 @@ func registerQuery(app *extkingpin.App) { | |
*enableTargetPartialResponse, | ||
*enableMetricMetadataPartialResponse, | ||
*enableExemplarPartialResponse, | ||
false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if maybe we can intercept by checking from here if the set value is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Saumya40-codes , so like writing an expression here? |
||
*activeQueryDir, | ||
time.Duration(*instantDefaultMaxSourceResolution), | ||
*defaultMetadataTimeRange, | ||
|
@@ -379,6 +381,7 @@ func runQuery( | |
enableTargetPartialResponse bool, | ||
enableMetricMetadataPartialResponse bool, | ||
enableExemplarPartialResponse bool, | ||
enableQueryExperimentalFunctions bool, | ||
activeQueryDir string, | ||
instantDefaultMaxSourceResolution time.Duration, | ||
defaultMetadataTimeRange time.Duration, | ||
|
@@ -464,6 +467,7 @@ func runQuery( | |
lookbackDelta, | ||
defaultEvaluationInterval, | ||
extendedFunctionsEnabled, | ||
enableQueryExperimentalFunctions, | ||
activeQueryTracker, | ||
queryMode, | ||
) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,7 @@ var ( | |
5*time.Minute, | ||
30*time.Second, | ||
true, | ||
false, | ||
nil, | ||
PromqlQueryModeLocal, | ||
) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,17 +202,18 @@ type Config struct { | |
LabelsConfig | ||
DownstreamTripperConfig | ||
|
||
CortexHandlerConfig *transport.HandlerConfig | ||
CompressResponses bool | ||
CacheCompression string | ||
RequestLoggingDecision string | ||
DownstreamURL string | ||
ForwardHeaders []string | ||
NumShards int | ||
TenantHeader string | ||
DefaultTenant string | ||
TenantCertField string | ||
EnableXFunctions bool | ||
CortexHandlerConfig *transport.HandlerConfig | ||
CompressResponses bool | ||
CacheCompression string | ||
RequestLoggingDecision string | ||
DownstreamURL string | ||
ForwardHeaders []string | ||
NumShards int | ||
TenantHeader string | ||
DefaultTenant string | ||
TenantCertField string | ||
EnableXFunctions bool | ||
EnableQueryExperimentalFunctions bool | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can use this field at e.g. https://github.com/thanos-io/thanos/blob/main/cmd/thanos/query_frontend.go#L161 |
||
} | ||
|
||
// QueryRangeConfig holds the config for query range tripperware. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this flag still need to be hidden, I wonder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was just to support it, so I am not sure either.