Skip to content

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

Closed
wants to merge 9 commits into from

Conversation

heysujal
Copy link

@heysujal heysujal commented Apr 5, 2025

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Fixes #7640

In thanos/query.go

  1. Added "promql-experimental-functions" in query.go
  2. Added cmd.Flag for enableQueryExperimentalFunctions
  3. Updated FeatureList Description
  4. Added logger for promqlExperimentalFunctions flag
  5. Updated query builder for the same

Added entry for the same in pkg/api/query/engine.go , pkg/queryfrontend/config.go, and test/e2e/e2ethanos/services.go

Verification

@heysujal heysujal marked this pull request as draft April 5, 2025 20:40
@heysujal heysujal marked this pull request as ready for review April 9, 2025 18:00
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix build

heysujal and others added 6 commits April 19, 2025 23:36
Signed-off-by: Sujal Gupta <[email protected]>
Signed-off-by: Sujal Gupta <[email protected]>
Adjust the default get-config timeout to match the default get-config
interval.

Signed-off-by: Michael Hoffmann <[email protected]>
Signed-off-by: Sujal Gupta <[email protected]>
Signed-off-by: Sujal Gupta <[email protected]>
@heysujal heysujal requested a review from yeya24 April 19, 2025 18:22
@@ -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()
Copy link
Member

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

Copy link
Author

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.

@@ -317,6 +318,7 @@ func registerQuery(app *extkingpin.App) {
*enableTargetPartialResponse,
*enableMetricMetadataPartialResponse,
*enableExemplarPartialResponse,
false,
Copy link
Contributor

@Saumya40-codes Saumya40-codes Apr 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if --enable-feature=promql-experimental-functions is set, this will still take it as false.

https://github.com/thanos-io/thanos/pull/8191/files#diff-f9808a0ac67a474a18f6a7ea767593f85c216aeafe322c1ff5d17c81ababff95R211-R221

maybe we can intercept by checking from here if the set value is promql-experimental-functions and pass true/false based on that.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Saumya40-codes , so like writing an expression here?

DefaultTenant string
TenantCertField string
EnableXFunctions bool
EnableQueryExperimentalFunctions bool
Copy link
Contributor

@Saumya40-codes Saumya40-codes Apr 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use this field at cmd/thanos/query_frontend.go now

e.g. https://github.com/thanos-io/thanos/blob/main/cmd/thanos/query_frontend.go#L161

@GiedriusS
Copy link
Member

Fixed in another PR. Thank you for your contribution!

@GiedriusS GiedriusS closed this Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FT add feature flag for 'promql-experimental-functions'.
6 participants