Skip to content
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

MQE: Add support to disable functions+aggregations by name #10384

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jhesketh
Copy link
Contributor

@jhesketh jhesketh commented Jan 9, 2025

Related to #10067

@jhesketh jhesketh requested a review from a team as a code owner January 9, 2025 05:46
@jhesketh jhesketh mentioned this pull request Jan 9, 2025
@jhesketh jhesketh force-pushed the jhesketh/mqe-function-flags branch from 8646304 to 28b5513 Compare January 9, 2025 06:19
@jhesketh jhesketh requested a review from tacole02 as a code owner January 9, 2025 06:19
pkg/streamingpromql/config.go Outdated Show resolved Hide resolved
pkg/streamingpromql/config.go Outdated Show resolved Hide resolved
pkg/streamingpromql/engine_test.go Outdated Show resolved Hide resolved
pkg/streamingpromql/operators/aggregations/common.go Outdated Show resolved Hide resolved
pkg/streamingpromql/query.go Outdated Show resolved Hide resolved
Comment on lines 319 to 320
if e.Func.Name == fName {
return nil, compat.NewNotSupportedError(fmt.Sprintf("'%s' function is disabled", e.Func.Name))
Copy link
Contributor

Choose a reason for hiding this comment

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

In all other cases, we don't differentiate between a feature being unsupported entirely and a feature being disabled by a feature flag:

Suggested change
if e.Func.Name == fName {
return nil, compat.NewNotSupportedError(fmt.Sprintf("'%s' function is disabled", e.Func.Name))
if e.Func.Name == fName {
return nil, compat.NewNotSupportedError(fmt.Sprintf("'%s' function", e.Func.Name))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel like this is a little more explicitly disabled so the log line is helpful

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure I follow sorry - isn't it just as explicit as any other feature disabled with a feature flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The others are "enable" which default to true. This explicitly disables something, which is useful to know in the logs imo.

pkg/streamingpromql/query.go Show resolved Hide resolved
Copy link
Contributor

@tacole02 tacole02 left a comment

Choose a reason for hiding this comment

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

Looks good. I removed a few instances of "will", as we try to avoid future tense in docs.

pkg/streamingpromql/engine.go Outdated Show resolved Hide resolved
pkg/streamingpromql/engine.go Outdated Show resolved Hide resolved
pkg/streamingpromql/config.go Outdated Show resolved Hide resolved
pkg/streamingpromql/operators/aggregations/common.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants