Skip to content

Commit

Permalink
fix(chstorage): remove unnecessary label conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
tdakkota committed Jun 11, 2024
1 parent 78e55af commit d214c03
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/chstorage/querier_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ func (p *promQuerier) getMatchingLabelValues(ctx context.Context, labelName stri

points = append(points, expHists...)
slices.Sort(points)
// Remove duplicates.
points = slices.Clip(points)

return points, nil
Expand Down Expand Up @@ -389,7 +390,7 @@ func (p *promQuerier) getLabelNames(ctx context.Context) (result []string, rerr
Query: query,
OnResult: func(ctx context.Context, block proto.Block) error {
for i := 0; i < value.Rows(); i++ {
result = append(result, otelstorage.KeyToLabel(value.Row(i)))
result = append(result, value.Row(i))
}
return nil
},
Expand Down Expand Up @@ -526,6 +527,7 @@ func (p *promQuerier) getMatchingLabelNames(ctx context.Context, matchers []*lab
points = append(points, labels.MetricName)
points = append(points, expHists...)
slices.Sort(points)
// Remove duplicates.
points = slices.Clip(points)

return points, nil
Expand Down

0 comments on commit d214c03

Please sign in to comment.