Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
This commit is contained in:
Bartlomiej Plotka 2026-05-08 10:17:57 +01:00 committed by GitHub
parent 38ccf6e7fe
commit ef01f33a03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 2 deletions

View File

@ -31,7 +31,7 @@ func (m TimeSeries) ToLabels(b *labels.ScratchBuilder, symbols []string) (labels
return desymbolizeLabels(b, m.GetLabelsRefs(), symbols)
}
// ToMetadata return model metadata from timeseries' remote metadata.
// ToMetadata returns model metadata from timeseries' remote metadata.
func (m TimeSeries) ToMetadata(symbols []string) (metadata.Metadata, error) {
typ := model.MetricTypeUnknown
switch m.Metadata.Type {

View File

@ -322,7 +322,6 @@ func (h *writeHandler) appendV2(app storage.Appender, req *writev2.Request, rs *
m, err := ts.ToMetadata(req.Symbols)
if err != nil {
badRequestErrs = append(badRequestErrs, fmt.Errorf("parsing metadata for series %v: %w", ts.LabelsRefs, err))
samplesWithInvalidLabels += len(ts.Samples) + len(ts.Histograms)
continue
}
if h.enableTypeAndUnitLabels && (m.Type != model.MetricTypeUnknown || m.Unit != "") {