Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* [ENHANCEMENT] Distributor: Add a label references validation for remote write v2 request. #7074
* [ENHANCEMENT] Distributor: Add count, spans, and buckets validations for native histogram. #7072
* [BUGFIX] Compactor: Avoid race condition which allow a grouper to not compact all partitions. #7082
* [BUGFIX] Fix bug where validating metric names uses the wrong validation logic. #7086

## 1.20.0 in progress

Expand Down
2 changes: 1 addition & 1 deletion pkg/util/validation/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func ValidateLabels(validateMetrics *ValidateMetrics, limits *Limits, userID str
return newNoMetricNameError()
}

if !nameValidationScheme.IsValidLabelName(unsafeMetricName) {
if !nameValidationScheme.IsValidMetricName(unsafeMetricName) {
validateMetrics.DiscardedSamples.WithLabelValues(invalidMetricName, userID).Inc()
return newInvalidMetricNameError(unsafeMetricName)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/util/validation/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func TestValidateLabels(t *testing.T) {
}, "foo "),
},
{
map[model.LabelName]model.LabelValue{model.MetricNameLabel: "valid"},
map[model.LabelName]model.LabelValue{model.MetricNameLabel: "valid:name"},
false,
nil,
},
Expand Down Expand Up @@ -203,7 +203,7 @@ func TestValidateLabels(t *testing.T) {
# HELP cortex_label_size_bytes The combined size in bytes of all labels and label values for a time series.
# TYPE cortex_label_size_bytes histogram
cortex_label_size_bytes_bucket{user="testUser",le="+Inf"} 3
cortex_label_size_bytes_sum{user="testUser"} 148
cortex_label_size_bytes_sum{user="testUser"} 153
cortex_label_size_bytes_count{user="testUser"} 3
`), "cortex_label_size_bytes"))

Expand Down
Loading