Skip to content
Open
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
13 changes: 11 additions & 2 deletions plugins/out_cloudwatch_logs/cloudwatch_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,17 @@
/* Maximum number of character limits including both the Attributes key and its value */
#define ATTRIBUTES_MAX_LEN 300

/* 256KiB minus 26 bytes for the event */
#define MAX_EVENT_LEN 262118
/*
* https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html
* AWS CloudWatch's documented maximum event size is 1,048,576 bytes (1 MiB),
* including JSON encoding overhead (structure, escaping, etc.).
*
* Setting MAX_EVENT_LEN to 1,000,000 bytes (1 MB) provides a ~4.6% safety margin
* to account for JSON encoding overhead and ensure reliable operation.
* Testing confirmed messages up to 1,048,546 bytes (encoding to 1,048,586 bytes)
* succeed, though we use a conservative limit for production safety.
*/
#define MAX_EVENT_LEN 1000000

/* Prefix used for entity fields only */
#define AWS_ENTITY_PREFIX "aws_entity"
Expand Down