-
Notifications
You must be signed in to change notification settings - Fork 17
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
Compress otlp payload with zlib #87
base: main
Are you sure you want to change the base?
Conversation
Fixes yangxikun#71 Also updates the otel-collector configuration file: * The `logging` exporter was renamed to `debug` * Jaeger now supports receiving OTLP traffic which makes things simpler
@plantfansam Could you review this PR? |
01e73b6
to
fa1d69a
Compare
82ff258
to
1cfc5d1
Compare
-- the compression should be set to Best Compression and window size | ||
-- should be set to 15+16, see reference below: | ||
-- https://github.com/brimworks/lua-zlib/issues/4#issuecomment-26383801 | ||
local deflate_stream = zlib.deflate(zlib.BEST_COMPRESSION, 15+16) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about this a bit more ... I think we should figure out how to do the compression in the otlp exporter's call_collector
method. This is because requests to the collector can retry multiple times, and we don't want to re-gzip the payload each time. That's what we do with protobuf encoding (see
res, res_error = exporter.client:do_request(pb_encoded_body) |
return call_collector(self, pb.encode(body)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good, shouldn't be hard 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the compression to the otlp exporter and adjusted the tests, I think it looks good, I am a bit worried that it pushes complexity into the worker init block but I'll you be the judge of that.
} | ||
|
||
return setmetatable(self, mt) | ||
end | ||
|
||
function _M.do_request(self, body) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we consider change do_request(self, body)
to do_request(self, body, additional_headers)
.
Then call do_request(body, ["Content-Encoding": "gzip"])
if gzip is enabled.
else | ||
otel_global.metrics_reporter:record_value( | ||
exporter_request_uncompressed_payload_size, string.len(pb_encoded_body)) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The gzip logic should move out while loop.
* another take on yangxikun#87
* another take on yangxikun#87
* another take on yangxikun#87
* another take on yangxikun#87
Adds gzip compression to the HTTP client.
Also updates the local otel-collector and docker-compose configurations, some of the configs have been renamed and OTLP support was added to Jaeger since the last update.
I've tested this locally, but I'm having trouble running the integration test suite, I'm hoping the GitHub Action will work OK.
Fixes #71