Skip to content

Commit

Permalink
perf(agent): Reduce complexity of creating new metrics to 'O(N_fields…
Browse files Browse the repository at this point in the history
…)' (#15889)
  • Loading branch information
LarsStegman authored Sep 16, 2024
1 parent e6d82bd commit ccdbc4c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion metric/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ func New(
if v == nil {
continue
}
m.AddField(k, v)

m.MetricFields = append(m.MetricFields, &telegraf.Field{Key: k, Value: v})
}
}

Expand Down

0 comments on commit ccdbc4c

Please sign in to comment.