File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 11require "base64"
22require "msgpack"
33require "net/https"
4+ require "zlib"
45
56require "logtail/config"
67require "logtail/log_devices/http/flushable_dropping_sized_queue"
@@ -168,7 +169,7 @@ def verify_delivery!
168169You can enable internal Logtail debug logging with the following:
169170
170171Logtail::Config.instance.debug_logger = ::Logger.new(STDOUT)
171- MESSAGE
172+ MESSAGE
172173 end
173174 end
174175
@@ -179,7 +180,7 @@ def verify_delivery!
179180You can enable internal debug logging with the following:
180181
181182Logtail::Config.instance.debug_logger = ::Logger.new(STDOUT)
182- MESSAGE
183+ MESSAGE
183184 end
184185
185186 private
@@ -205,8 +206,10 @@ def build_request(msgs)
205206 req = Net ::HTTP ::Post . new ( path )
206207 req [ 'Authorization' ] = authorization_payload
207208 req [ 'Content-Type' ] = CONTENT_TYPE
209+ req [ 'Content-Encoding' ] = 'gzip'
208210 req [ 'User-Agent' ] = USER_AGENT
209- req . body = msgs . map { |msg | force_utf8_encoding ( msg . to_hash ) } . to_msgpack
211+ uncompressed = msgs . map { |msg | force_utf8_encoding ( msg . to_hash ) } . to_msgpack
212+ req . body = Zlib ::Deflate . deflate ( uncompressed )
210213 req
211214 end
212215
You can’t perform that action at this time.
0 commit comments