Skip to content

Increase max event size to 1MB #265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ rake test

## Caution

If an event message exceeds API limit (256KB), the event will be discarded.
If an event message exceeds API limit (1MB), the event will be discarded.

## Cross-Account Operation

Expand Down
2 changes: 1 addition & 1 deletion lib/fluent/plugin/out_cloudwatch_logs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class TooLargeEventError < Fluent::UnrecoverableError; end
end

MAX_EVENTS_SIZE = 1_048_576
MAX_EVENT_SIZE = 256 * 1024
MAX_EVENT_SIZE = 1024 * 1024
EVENT_HEADER_SIZE = 26

def initialize
Expand Down
4 changes: 2 additions & 2 deletions test/plugin/test_out_cloudwatch_logs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -974,11 +974,11 @@ def test_too_large_event
@log_level debug
EOC
d.run(default_tag: fluentd_tag) do
d.feed(time, {'message' => '*' * 256 * 1024})
d.feed(time, {'message' => '*' * 1024 * 1024})
end

logs = d.logs
assert(logs.any?{|log| log =~ /Log event in .* discarded because it is too large: 262184 bytes exceeds limit of 262144/})
assert(logs.any?{|log| log =~ /Log event in .* discarded because it is too large/})
end

def test_do_not_emit_empty_record
Expand Down