From 92f8c4d9dd28dcab6bf1fbae3e8dd8c3dde2a471 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Mon, 15 Jul 2024 18:35:00 -0600 Subject: [PATCH] metrics_exporter: use sds to get metric name Signed-off-by: Eduardo Silva --- src/flb_metrics_exporter.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/flb_metrics_exporter.c b/src/flb_metrics_exporter.c index 8547a15f872..2e1b98f21a4 100644 --- a/src/flb_metrics_exporter.c +++ b/src/flb_metrics_exporter.c @@ -63,8 +63,8 @@ static int collect_inputs(msgpack_sbuffer *mp_sbuf, msgpack_packer *mp_pck, } flb_metrics_dump_values(&buf, &s, i->metrics); - msgpack_pack_str(mp_pck, i->metrics->title_len); - msgpack_pack_str_body(mp_pck, i->metrics->title, i->metrics->title_len); + msgpack_pack_str(mp_pck, flb_sds_len(i->metrics->title)); + msgpack_pack_str_body(mp_pck, i->metrics->title, flb_sds_len(i->metrics->title)); msgpack_sbuffer_write(mp_sbuf, buf, s); flb_free(buf); } @@ -100,8 +100,8 @@ static int collect_filters(msgpack_sbuffer *mp_sbuf, msgpack_packer *mp_pck, } flb_metrics_dump_values(&buf, &s, i->metrics); - msgpack_pack_str(mp_pck, i->metrics->title_len); - msgpack_pack_str_body(mp_pck, i->metrics->title, i->metrics->title_len); + msgpack_pack_str(mp_pck, flb_sds_len(i->metrics->title)); + msgpack_pack_str_body(mp_pck, i->metrics->title, flb_sds_len(i->metrics->title)); msgpack_sbuffer_write(mp_sbuf, buf, s); flb_free(buf); } @@ -137,8 +137,8 @@ static int collect_outputs(msgpack_sbuffer *mp_sbuf, msgpack_packer *mp_pck, } flb_metrics_dump_values(&buf, &s, i->metrics); - msgpack_pack_str(mp_pck, i->metrics->title_len); - msgpack_pack_str_body(mp_pck, i->metrics->title, i->metrics->title_len); + msgpack_pack_str(mp_pck, flb_sds_len(i->metrics->title)); + msgpack_pack_str_body(mp_pck, i->metrics->title, flb_sds_len(i->metrics->title)); msgpack_sbuffer_write(mp_sbuf, buf, s); flb_free(buf); }