Skip to content
Merged
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
16 changes: 9 additions & 7 deletions pkg/distributor/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ func (d *Distributor) visitSampleSeries(req *distributormodel.PushRequest, visit
validation.DiscardedProfiles.WithLabelValues(string(validation.ReasonOf(err)), req.TenantID).Add(float64(req.TotalProfiles))
validation.DiscardedBytes.WithLabelValues(string(validation.ReasonOf(err)), req.TenantID).Add(float64(req.TotalBytesUncompressed))
usageGroups.CountDiscardedBytes(string(validation.ReasonOf(err)), req.TotalBytesUncompressed)
return err
return connect.NewError(connect.CodeInvalidArgument, err)
}
for _, s := range visitor.series {
s.Annotations = series.Annotations
Expand All @@ -1045,8 +1045,13 @@ func (d *Distributor) visitSampleSeries(req *distributormodel.PushRequest, visit
}
}

validation.DiscardedBytes.WithLabelValues(string(validation.DroppedByRelabelRules), req.TenantID).Add(float64(req.DiscardedBytesRelabeling))
validation.DiscardedProfiles.WithLabelValues(string(validation.DroppedByRelabelRules), req.TenantID).Add(float64(req.DiscardedProfilesRelabeling))
if req.DiscardedBytesRelabeling > 0 {
validation.DiscardedBytes.WithLabelValues(string(validation.DroppedByRelabelRules), req.TenantID).Add(float64(req.DiscardedBytesRelabeling))
}
if req.DiscardedProfilesRelabeling > 0 {
validation.DiscardedProfiles.WithLabelValues(string(validation.DroppedByRelabelRules), req.TenantID).Add(float64(req.DiscardedProfilesRelabeling))
}

req.Series = result
removeEmptySeries(req)
return nil
Expand Down Expand Up @@ -1075,10 +1080,7 @@ type sampleSeriesVisitor struct {
}

func (v *sampleSeriesVisitor) ValidateLabels(labels phlaremodel.Labels) error {
if err := validation.ValidateLabels(v.limits, v.tenantID, labels); err != nil {
return connect.NewError(connect.CodeInvalidArgument, err)
}
return nil
return validation.ValidateLabels(v.limits, v.tenantID, labels)
Comment on lines -1078 to +1083
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like it's the caller's responsibility to wrap the error

}

func (v *sampleSeriesVisitor) VisitProfile(labels phlaremodel.Labels) {
Expand Down
Loading