lib/fluent/plugin/out_newrelic.rb in fluent-plugin-newrelic-1.2.2 vs lib/fluent/plugin/out_newrelic.rb in fluent-plugin-newrelic-1.2.3

- old
+ new

@@ -136,19 +136,21 @@ if compressed_payload.bytesize <= MAX_PAYLOAD_SIZE return [compressed_payload] end + compressed_payload_bytesize = compressed_payload.bytesize compressed_payload = nil # Free for GC if logs.length > 1 # we can split # let's split logs array by half, and try to create payloads again midpoint = logs.length / 2 first_half = get_compressed_payloads(logs.slice(0, midpoint)) second_half = get_compressed_payloads(logs.slice(midpoint, logs.length)) return first_half + second_half else - log.error("Can't compress record below required maximum packet size and it will be discarded. Record: #{logs[0]}") + log.error("Can't compress record below required maximum packet size and it will be discarded. " + + "Record timestamp: #{logs[0]['timestamp']}. Compressed size: #{compressed_payload_bytesize} bytes. Uncompressed size: #{payload.to_json.bytesize} bytes.") return [] end end def create_payload(logs)