From f39d970738a60a550c27d92e4fe2b0fe79abd1a6 Mon Sep 17 00:00:00 2001 From: Matthew Fala Date: Wed, 1 Sep 2021 15:52:53 -0700 Subject: [PATCH] out_kinesis_firehose: support auto_retry_requests for failed connections Signed-off-by: Matthew Fala --- plugins/out_kinesis_firehose/firehose.c | 11 +++++++++++ plugins/out_kinesis_firehose/firehose.h | 1 + 2 files changed, 12 insertions(+) diff --git a/plugins/out_kinesis_firehose/firehose.c b/plugins/out_kinesis_firehose/firehose.c index 1b7203ee465..d3054eec975 100644 --- a/plugins/out_kinesis_firehose/firehose.c +++ b/plugins/out_kinesis_firehose/firehose.c @@ -243,6 +243,7 @@ static int cb_firehose_init(struct flb_output_instance *ins, ctx->firehose_client->has_auth = FLB_TRUE; ctx->firehose_client->provider = ctx->aws_provider; ctx->firehose_client->region = (char *) ctx->region; + ctx->firehose_client->retry_requests = ctx->retry_requests; ctx->firehose_client->service = "firehose"; ctx->firehose_client->port = 443; ctx->firehose_client->flags = 0; @@ -436,6 +437,16 @@ static struct flb_config_map config_map[] = { "the log message will be sent to Firehose." }, + { + FLB_CONFIG_MAP_BOOL, "auto_retry_requests", "false", + 0, FLB_TRUE, offsetof(struct flb_firehose, retry_requests), + "Immediately retry failed requests to AWS services once. This option " + "does not affect the normal Fluent Bit retry mechanism with backoff. " + "Instead, it enables an immediate retry with no delay for networking " + "errors, which may help improve throughput when there are transient/random " + "networking issues." + }, + /* EOF */ {0} }; diff --git a/plugins/out_kinesis_firehose/firehose.h b/plugins/out_kinesis_firehose/firehose.h index 329be7bf8a1..7f84e0002dc 100644 --- a/plugins/out_kinesis_firehose/firehose.h +++ b/plugins/out_kinesis_firehose/firehose.h @@ -88,6 +88,7 @@ struct flb_firehose { const char *log_key; char *sts_endpoint; int custom_endpoint; + int retry_requests; /* must be freed on shutdown if custom_endpoint is not set */ char *endpoint;