From 49fec1cdb69689647a8fe193c728a5cf9144575e Mon Sep 17 00:00:00 2001 From: avilevy Date: Tue, 3 Oct 2023 18:31:32 +0000 Subject: [PATCH] Small bug fix --- plugins/out_stackdriver/stackdriver.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/out_stackdriver/stackdriver.c b/plugins/out_stackdriver/stackdriver.c index a4afab94a3f..a7571a80261 100644 --- a/plugins/out_stackdriver/stackdriver.c +++ b/plugins/out_stackdriver/stackdriver.c @@ -2728,8 +2728,10 @@ static void cb_stackdriver_flush(struct flb_event_chunk *event_chunk, } else if (c->resp.status >= 400 && c->resp.status < 500) { ret_code = FLB_ERROR; - ret = parse_partial_success_response(c, ctx, &partial_failure); - cmt_counter_add(ctx->cmt_failed_requests, ts, (double)partial_failure, 1, (char *[]) {name}); + if(c->resp.status == 400){ + ret = parse_partial_success_response(c, ctx, &partial_failure); + cmt_counter_add(ctx->cmt_failed_requests, ts, (double)partial_failure, 1, (char *[]) {name}); + } flb_plg_warn(ctx->ins, "error\n%s", c->resp.payload);