perf(agent): Reduce complexity of creating new metrics to 'O(N_fields)' (#15889)

This commit is contained in:
Lars Stegman 2024-09-16 17:57:55 +02:00 committed by GitHub
parent e6d82bd996
commit ccdbc4c480
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -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})
}
}