Skip to content

Commit

Permalink
Don't error on adding submetrics again, reuse them
Browse files Browse the repository at this point in the history
fixes #2538
  • Loading branch information
mstoykov committed May 17, 2022
1 parent 5c35728 commit 0f4fa89
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions metrics/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,7 @@ func (m *Metric) AddSubmetric(keyValues string) (*Submetric, error) {

for _, sm := range m.Submetrics {
if sm.Tags.IsEqual(tags) {
return nil, fmt.Errorf(
"sub-metric with params '%s' already exists for metric %s: %s",
keyValues, m.Name, sm.Name,
)
return sm, nil
}
}

Expand Down

0 comments on commit 0f4fa89

Please sign in to comment.