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

chore: refactor PromQL enforcer #225

Conversation

simonpasquier
Copy link
Contributor

This change renames the Enforcer struct to PromQLEnforcer to clarify its purpose. It also removes the error type casting in favor of error wrapping.

Copy link
Member

@squat squat left a comment

Choose a reason for hiding this comment

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

I think this is cool! I'm sometimes hesitant about replying with the invalid (read: potentially malicious) query string in the http response, since that could lead to exploits, but this is escaped as JSON so it should be ok

@simonpasquier
Copy link
Contributor Author

You've got a good point regarding not returning the bad PromQL expression. I'll change this (it will also be consistent with the Prometheus API).

This change renames the Enforcer struct to PromQLEnforcer to clarify its
purpose. It also removes the error type casting in favor of error
wrapping.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
@simonpasquier simonpasquier merged commit 435301e into prometheus-community:main Jun 7, 2024
4 checks passed
@simonpasquier simonpasquier deleted the refactor-promql-enforce branch June 7, 2024 20:36
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.

None yet

2 participants