diff --git a/plugins/out_cloudwatch_logs/cloudwatch_logs.c b/plugins/out_cloudwatch_logs/cloudwatch_logs.c index f3898355eb2..73af4739771 100644 --- a/plugins/out_cloudwatch_logs/cloudwatch_logs.c +++ b/plugins/out_cloudwatch_logs/cloudwatch_logs.c @@ -344,13 +344,6 @@ static int cb_cloudwatch_init(struct flb_output_instance *ins, goto error; } - /* - * Remove async flag from upstream - * CW output runs in sync mode; because the CW API currently requires - * PutLogEvents requests to a log stream to be made serially - */ - upstream->flags &= ~(FLB_IO_ASYNC); - ctx->cw_client->upstream = upstream; flb_output_upstream_set(upstream, ctx->ins); ctx->cw_client->host = ctx->endpoint; @@ -666,7 +659,12 @@ struct flb_output_plugin out_cloudwatch_logs_plugin = { .cb_init = cb_cloudwatch_init, .cb_flush = cb_cloudwatch_flush, .cb_exit = cb_cloudwatch_exit, - .flags = 0, + + /* + * Allow cloudwatch to use async network stack synchronously by opting into + * FLB_OUTPUT_SYNCHRONOUS synchronous task scheduler + */ + .flags = FLB_OUTPUT_SYNCHRONOUS, .workers = 1, /* Configuration */