From 1d95059f028d0d9392e470120f8251dc2b324e51 Mon Sep 17 00:00:00 2001 From: ryanohnemus Date: Mon, 5 Feb 2024 18:21:19 -0600 Subject: [PATCH] out_stackdriver: print tag with api error message Signed-off-by: ryanohnemus --- plugins/out_stackdriver/stackdriver.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/out_stackdriver/stackdriver.c b/plugins/out_stackdriver/stackdriver.c index e3adeb758b9..7889deba095 100644 --- a/plugins/out_stackdriver/stackdriver.c +++ b/plugins/out_stackdriver/stackdriver.c @@ -2942,15 +2942,18 @@ static void cb_stackdriver_flush(struct flb_event_chunk *event_chunk, #endif if (c->resp.status >= 400 && c->resp.status < 500) { ret_code = FLB_ERROR; - flb_plg_warn(ctx->ins, "error: %s", c->resp.payload); + flb_plg_warn(ctx->ins, "error for tag=%s: %s", event_chunk->tag, + c->resp.payload); } else { if (c->resp.payload_size > 0) { /* we got an error */ - flb_plg_warn(ctx->ins, "error: %s", c->resp.payload); + flb_plg_warn(ctx->ins, "error for tag=%s: %s", event_chunk->tag, + c->resp.payload); } else { - flb_plg_debug(ctx->ins, "response: %s", c->resp.payload); + flb_plg_debug(ctx->ins, "response for tag=%s: %s", event_chunk->tag, + c->resp.payload); } ret_code = FLB_RETRY; }