Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion plugins/out_http/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,15 @@ static int http_post(struct flb_out_http *ctx,
flb_plg_error(ctx->ins, "%s:%i, HTTP status=%i",
ctx->host, ctx->port, c->resp.status);
}
out_ret = FLB_RETRY;
if (c->resp.status >= 400 && c->resp.status < 500 && c->resp.status != 429) {
flb_plg_warn(ctx->ins, "could not flush records to %s:%i (http_do=%i), "
"chunk will not be retried",
ctx->host, ctx->port, ret);
out_ret = FLB_ERROR;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that mean logs will be lost when the endpoint is unavailable?

Copy link
Contributor Author

@IsraelZeromski IsraelZeromski May 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. if return a code in 4xx range except 429, this means that the are an error in client side in consequence that records will not be retry.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fluentd has a setting for retryable response codes: https://docs.fluentd.org/output/http#retryable_response_codes maybe we could add this as well?

}
else {
out_ret = FLB_RETRY;
}
}
else {
if (ctx->log_response_payload &&
Expand Down