From: Michael Tremer Date: Fri, 29 May 2026 11:09:31 +0000 (+0000) Subject: metrics: Allow to push multiple values X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f55d06d9f471e6c0d4ec5801e92e9b858e36271e;p=telemetry.git metrics: Allow to push multiple values We will just sum the data because there are sometimes sources that have multiple metrics that we need to aggregate - for example counters per worker/thread. Signed-off-by: Michael Tremer --- diff --git a/src/daemon/metrics.c b/src/daemon/metrics.c index 67d1e0f..4b05833 100644 --- a/src/daemon/metrics.c +++ b/src/daemon/metrics.c @@ -337,15 +337,15 @@ static int td_metrics_push_value(td_metrics* self, break; case TD_METRIC_INT64: - metric->value._int64 = *(int64_t*)value; + metric->value._int64 += *(int64_t*)value; break; case TD_METRIC_UINT64: - metric->value._uint64 = *(uint64_t*)value; + metric->value._uint64 += *(uint64_t*)value; break; case TD_METRIC_FLOAT: - metric->value._float = *(double*)value; + metric->value._float += *(double*)value; break; }