Skip to content

Commit

Permalink
out_stackdriver: print tag with api error message
Browse files Browse the repository at this point in the history
Signed-off-by: ryanohnemus <[email protected]>
  • Loading branch information
ryanohnemus committed Feb 16, 2024
1 parent 689afa1 commit 1d95059
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions plugins/out_stackdriver/stackdriver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1d95059

Please sign in to comment.