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

Add metric name validation #36

Merged
merged 9 commits into from
Dec 6, 2023

Conversation

tizki
Copy link
Contributor

@tizki tizki commented Dec 5, 2023

supporting metric name validation in alerts for issues/33
it supports both cases of metric name
metric_name{job="foo"}
and
{name="metric_name", job="foo"}

Copy link
Owner

@FUSAKLA FUSAKLA left a comment

Choose a reason for hiding this comment

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

Great, thanks a lot for the contribution!
The code looks great, just a few nits and one thing about the error reporting, which could be a bit more user-friendly.

Also, may I ask also for documenting the validator here? 🙏

pkg/validator/expression.go Outdated Show resolved Hide resolved
pkg/validator/expression.go Outdated Show resolved Hide resolved
pkg/validator/expression_helpers.go Outdated Show resolved Hide resolved
pkg/validator/validator_test.go Outdated Show resolved Hide resolved
@FUSAKLA FUSAKLA self-assigned this Dec 5, 2023
@FUSAKLA FUSAKLA added the enhancement New feature or request label Dec 5, 2023
@FUSAKLA FUSAKLA linked an issue Dec 5, 2023 that may be closed by this pull request
Copy link
Owner

@FUSAKLA FUSAKLA left a comment

Choose a reason for hiding this comment

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

Nice! 👍
Thanks for all the work, and sorry for the comments, hope it didn't felt too much pedantic or unreasonable :)

I'll just wait for the CI pass and release it ASAP

@FUSAKLA FUSAKLA merged commit 50ae730 into FUSAKLA:master Dec 6, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

validate that an expressions uses metric name
2 participants