Skip to content

Commit

Permalink
fix: remove duplicate service detection for distributor
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorwhitney committed Aug 1, 2024
1 parent fe447f5 commit c03db1f
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions pkg/distributor/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -787,22 +787,6 @@ func (d *Distributor) parseStreamLabels(vContext validationContext, key string,
return nil, "", 0, err
}

// We do not want to count service_name added by us in the stream limit so adding it after validating original labels.
// We also don't want to add service name to aggregated metrics.
if !ls.Has(push.LabelServiceName) && !ls.Has(push.AggregatedMetricLabel) &&
len(vContext.discoverServiceName) > 0 {
serviceName := push.ServiceUnknown
for _, labelName := range vContext.discoverServiceName {
if labelVal := ls.Get(labelName); labelVal != "" {
serviceName = labelVal
break
}
}

ls = labels.NewBuilder(ls).Set(push.LabelServiceName, serviceName).Labels()
stream.Labels = ls.String()
}

lsHash := ls.Hash()

d.labelCache.Add(key, labelData{ls, lsHash})
Expand Down

0 comments on commit c03db1f

Please sign in to comment.