-
Notifications
You must be signed in to change notification settings - Fork 814
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
Put metric before label value in error message when 'label value too long' #3982
Conversation
9697e9b
to
25bbfed
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.
Thanks for working on this! LGTM (modulo a couple of nits)
CHANGELOG.md
Outdated
@@ -10,6 +10,7 @@ | |||
* `-alertmanager.cluster.advertise-address` instead of `-cluster.advertise-address` | |||
* `-alertmanager.cluster.peers` instead of `-cluster.peer` | |||
* `-alertmanager.cluster.peer-timeout` instead of `-cluster.peer-timeout` | |||
* [CHANGE] Put metric before label value in error message when `labelValueTooLong`. #3982 |
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.
* [CHANGE] Put metric before label value in error message when `labelValueTooLong`. #3982 | |
* [ENHANCEMENT] Put metric before label value in the "label value too long" error message. #3982 |
pkg/util/validation/validate.go
Outdated
@@ -35,7 +35,7 @@ const ( | |||
errInvalidMetricName = "sample invalid metric name: %.200q" | |||
errInvalidLabel = "sample invalid label: %.200q metric %.200q" | |||
errLabelNameTooLong = "label name too long: %.200q metric %.200q" | |||
errLabelValueTooLong = "label value too long: %.200q metric %.200q" | |||
errLabelValueTooLong = "label value too long: metric %.200q value %.200q" |
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.
errLabelValueTooLong = "label value too long: metric %.200q value %.200q" | |
errLabelValueTooLong = "label value too long for metric %.200q label name: %.200q" |
…long' (cortexproject#1582) Signed-off-by: ChinYing-Li <[email protected]>
@ChinYing-Li Sorry to bother you. I've just merged #3990 which impacts on this PR. Could you apply the same change (picking up the suggestion I gave above) to the error which is now defined in |
Given the refactor, now there's no simple way to identify whether s |
I think the solution is to not use |
Yes, I agree. |
Closing this PR. Relevant development done based on recent changes is at #4018. |
(#1582)
Signed-off-by: ChinYing-Li [email protected]
What this PR does:
Swap the position of the metric string and the label value string in error message of
labelValueTooLong
.Now the metric string is placed before the label value string.
Which issue(s) this PR fixes:
Fixes #1582
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]