metrics/influxdb: temp solution to present counter meaningfully (#24811)

This commit is contained in:
Daniel Liu 2024-12-13 14:00:12 +08:00
parent d77c1e5ea3
commit 7b0a7e4593

View file

@ -104,17 +104,15 @@ func (r *reporter) send() error {
switch metric := i.(type) {
case metrics.Counter:
v := metric.Count()
l := r.cache[name]
count := metric.Count()
pts = append(pts, client.Point{
Measurement: fmt.Sprintf("%s%s.count", namespace, name),
Tags: r.tags,
Fields: map[string]interface{}{
"value": v - l,
"value": count,
},
Time: now,
})
r.cache[name] = v
case metrics.Gauge:
ms := metric.Snapshot()
pts = append(pts, client.Point{