newrelic-ruby-agent
newrelic-ruby-agent copied to clipboard
Modernize the approach the agent takes to gzip outbound payloads before sending them to the collector
We appear to be using what I hypothesize is a fork of an older version of the Zlib gem's gzip compression logic to gzip our outbound payloads.
We should see if we can modernize our approach while retaining compatibility with all supported Ruby versions.
To gzip some data, we should need only to do this:
require 'zlib'
Zlib.gzip(text)
We may be able to replace the module NewRelic::Agent::Encoders::Compressed::Gzip with the code above. It is used in NewRelic::Agent::Service#compress_request_if_needed
Acceptance Criteria
- Make sure the included Zlib library works on all agent-supported Ruby versions
- Run some performance benchmarks between
Encoders::Compressed::Gzip.encode(data)andZlib.gzipto make sure theZlib.gzipoption is more performant
https://issues.newrelic.com/browse/NEWRELIC-4900