From a6aac459d5ec1d1d591986f4e130cc7b69ffe56f Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Sun, 4 Aug 2024 07:21:32 +0900 Subject: [PATCH] in_node_exporter_metrics: Align the collecting metrics of unit statuses (#9134) Signed-off-by: Hiroshi Hatake --- plugins/in_node_exporter_metrics/ne_systemd_linux.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/in_node_exporter_metrics/ne_systemd_linux.c b/plugins/in_node_exporter_metrics/ne_systemd_linux.c index f0db5aa0fc7..ffd265bc041 100644 --- a/plugins/in_node_exporter_metrics/ne_systemd_linux.c +++ b/plugins/in_node_exporter_metrics/ne_systemd_linux.c @@ -459,7 +459,7 @@ static int ne_systemd_update_unit_state(struct flb_ne *ctx) } for(index = 0 ; index < 5 ; index++) { - cmt_gauge_add(ctx->systemd_unit_state, + cmt_gauge_set(ctx->systemd_unit_state, timestamp, 0, 3, @@ -469,8 +469,9 @@ static int ne_systemd_update_unit_state(struct flb_ne *ctx) }); } - cmt_gauge_inc(ctx->systemd_unit_state, + cmt_gauge_set(ctx->systemd_unit_state, timestamp, + 1, 3, (char *[]){ unit.name, unit.active_state,