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 LintDuplicateMetric to promlint #1472

Merged
merged 1 commit into from
Mar 24, 2024
Merged

Add LintDuplicateMetric to promlint #1472

merged 1 commit into from
Mar 24, 2024

Conversation

bboreham
Copy link
Member

This is from prometheus/prometheus#5312; the code moved to this repo since that PR was opened.

@geekodour is the original author.

Signed-off-by: Hrishikesh Barman <hrishikeshbman@gmail.com>
Copy link
Member

@ArthurSens ArthurSens left a comment

Choose a reason for hiding this comment

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

LGTM

I've just made one comment but we can open an issue and tackle it in a separate PR if you prefer

Comment on lines +30 to +31
problems = append(problems, fmt.Errorf("metric not unique"))
break
Copy link
Member

Choose a reason for hiding this comment

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

If we break here we'll only return the first problem. Since we're returning an array of errors I wonder if we don't want to return all duplicated metrics instead of only the first one.

Copy link
Member

Choose a reason for hiding this comment

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

Nevermind, I've just realized we're braking only the inner for loop

LGTM!

@ArthurSens ArthurSens merged commit 26e3055 into main Mar 24, 2024
9 checks passed
@ArthurSens ArthurSens deleted the i5242 branch March 24, 2024 10:03
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

3 participants