-
Notifications
You must be signed in to change notification settings - Fork 512
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
Query-frontend: Add experimental query blocker #5609
Conversation
e0321fb
to
a086fbd
Compare
2f81022
to
cde3fe8
Compare
|
Sorry about closing the PR; I have no idea what keystroke I mistakenly just used. Eek. |
cde3fe8
to
ca07837
Compare
thank you @osg-grafana, I've taken into account your remarks. |
# Configure queries to block | ||
|
||
In certain situations, you might want to control what queries are being sent to your Mimir installation. These queries | ||
might be intentionally or unintentionally expensive to run, and they might affect the overall stability or cost of running |
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.
Hi @wilfriedroset, perhaps for my personal learning, but why would a query ever be intentionally expensive to run? It sounds like there is something underneath this idea and the result is that a given query is expensive to run.
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.
From a service provider, we might be exposed to denial of service, this is where such features are useful.
For example, a single user looking to cause harm to your service could storm the Mimir cluster with queries that would not be stopped by the current limits.
In that event, either the cluster is scaled or the quality of service decrease.
Most of this work is inspired and/or copied from Loki.
Loki's documentation contains the same phrase: https://grafana.com/docs/loki/latest/operations/blocking-queries/
ca07837
to
7f41cc7
Compare
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.
This looks great! Thanks for your patience with this PR.
I left a few comments, can you take a look?
|
||
for _, block := range blocks { | ||
if strings.TrimSpace(block.Pattern) == strings.TrimSpace(query) { | ||
level.Warn(logger).Log("msg", "query blocker matched with exact match policy", "query", query) |
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.
I'd make this an Info
log line. Everything is working as intended.
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.
On another note: it might be useful to identify which rule is blocking the query. Maybe something as simple as the index of the rule will be enough to debug block configurations.
The CHANGELOG has just been cut to prepare for the next Mimir release. Please rebase |
c3e4e26
to
a70f9b1
Compare
Sorry about the delay @dimitarvdimitrov I was on PTO. |
a70f9b1
to
ecae801
Compare
7f8d3ba
to
d64df6b
Compare
This commit implements the following proposal: grafana#5029 Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>
d64df6b
to
d7425bf
Compare
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.
LGTM, great work! And thanks for addressing my feedback.
@osg-grafana do you have any other remarks on the docs or are we good to merge this?
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.
Thanks @wilfriedroset ! Do you mind adding the feature to the list of experimental features listed at docs/sources/mimir/configure/about-versioning.md
?
What this PR does
Add experimental query blocker
Which issue(s) this PR fixes or relates to
This commit implements the following proposal: #5029
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]