-
Notifications
You must be signed in to change notification settings - Fork 812
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 the "label value too long" error mes… #4018
Conversation
f579913
to
4b7bcb9
Compare
4b7bcb9
to
8c447fb
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.
Thank you!
pkg/util/validation/errors.go
Outdated
return &genericValidationError{ | ||
message: "label value too long: %.200q metric %.200q", | ||
return &labelValueTooLongError{ | ||
message: "label value too long for metric: %.200q name %.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.
I'd suggest to remove message
field in labelValueTooLongError
completely, and put this message into (*labelValueTooLongError).Error()
method (fmt.Sprintf
call), so that the message and correct order of parameters are together.
8c447fb
to
eaaf3ff
Compare
@ChinYing-Li Could you fix the linter, please? |
4bf8bc4
to
b7b1bf8
Compare
pkg/util/validation/errors.go
Outdated
} | ||
|
||
func (e *labelValueTooLongError) Error() string { | ||
return fmt.Sprintf("label value too long for metric: %.200q label valu%.200q", formatLabelSet(e.series), e.cause) |
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.
return fmt.Sprintf("label value too long for metric: %.200q label valu%.200q", formatLabelSet(e.series), e.cause) | |
return fmt.Sprintf("label value too long for metric: %.200q label value: %.200q", formatLabelSet(e.series), e.cause) |
b7b1bf8
to
590b21b
Compare
Sorry about the problem with linting! Just fixed that. |
590b21b
to
dec952a
Compare
…sage (cortexproject#1582) Signed-off-by: ChinYing-Li <[email protected]> Fix wrong message
dec952a
to
4bcecd8
Compare
Signed-off-by: ChinYing-Li <[email protected]>
f2d0715
to
7dccf7f
Compare
…sage (#1582)
Signed-off-by: ChinYing-Li [email protected]
What this PR does:
This PR is #3982 applied to
d45e65ad1e90d22dbdbe224f6eb4036847b56c82
.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]