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

feat: Allow disabling validations by comments inside the rule expresion. #26

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

rudo-thomas
Copy link
Collaborator

@rudo-thomas rudo-thomas commented Jun 7, 2022

We are generating some of our Prometheus rules by jsonnet, which outputs JSON, making it impossible to generate the disable_validations comment for a particular rule.

This PR allows using the comment inside the rules' expr as long as it is on its own line within the expression. See the Prometheus docs.

I also fixed a little bug in the handling of the YAML comment: It is now possible to have comment lines that follow the disable_validations line.

Plus a few typos in the README.

@FUSAKLA
Copy link
Owner

FUSAKLA commented Jun 7, 2022

Looks good, thanks! 🚀

@FUSAKLA FUSAKLA merged commit a1b8407 into master Jun 7, 2022
@rudo-thomas rudo-thomas deleted the rudo-thomas-allow-disable-validations-inside-expr branch June 7, 2022 19:43
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.

2 participants