-
Notifications
You must be signed in to change notification settings - Fork 833
Validate empty labels in push #7052
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
Validate empty labels in push #7052
Conversation
21b09ab
to
eb0be55
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.
I wonder why this validation is applied in convertV2RequestToV1
. Isn't the same thing applied for V1 push logic?
We already have labels validation logic in
cortex/pkg/util/validation/validate.go
Line 281 in 5b7b4f5
if limits.EnforceMetricName { |
pkg/util/push/push.go
Outdated
lbs := v2Ts.ToLabels(&b, symbols) | ||
// PRW2 spec allows UTF-8. | ||
// c.f. https://prometheus.io/docs/specs/prw/remote_write_spec_2_0/#series-labels | ||
if !lbs.Has(labels.MetricName) || !lbs.IsValid(model.UTF8Validation) { |
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.
We may need to check name validation scheme first? UTF-8 may not be enabled.
Or this validation will be applied later in distributor's push logic
I wonder if this is the right problem. I think the validation logic should apply for both v1 and v2 |
eb0be55
to
0d78022
Compare
0d78022
to
6badbc1
Compare
@yeya24 |
Signed-off-by: SungJin1212 <[email protected]>
6badbc1
to
a4389c5
Compare
Let's update the PR title. Now this change is not specific to PRW2 |
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.
Thx
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
Add label validations to Prometheus remote write 2.0
Which issue(s) this PR fixes:
Fixes #7043
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]