decompressor filter: add bytes reporting to trailers#12477
decompressor filter: add bytes reporting to trailers#12477junr03 merged 14 commits intoenvoyproxy:masterfrom junr03:decompressor-trailers
Conversation
Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: Jose Nino <jnino@lyft.com>
|
@rojkov do you mind taking a pass at this? @rebello95 if you want to take a pass too. |
Signed-off-by: Jose Nino <jnino@lyft.com>
|
I'm on holidays till the middle of August. I'll be happy to give it a pass later if it's still open. |
| EXPECT_EQ("30", | ||
| response_trailers | ||
| .get(Http::LowerCaseString("x-envoy-decompressor-testlib-compressed-bytes")) | ||
| ->value() | ||
| .getStringView()); | ||
| EXPECT_EQ("60", |
There was a problem hiding this comment.
Might be nice to use different body sizes for request/response to also differentiate
source/extensions/filters/http/decompressor/decompressor_filter.h
Outdated
Show resolved
Hide resolved
| decompressor->decompress(input_buffer, output_buffer); | ||
|
|
||
| // Report decompression via stats and logging before modifying the input buffer. | ||
| byte_tracker.chargeBytes(input_buffer.length(), output_buffer.length()); |
There was a problem hiding this comment.
Checking desired behavior: Do we want to only increment byte counts if we actually do decompression (versus regardless of if we do decompression)?
There was a problem hiding this comment.
you mean if decompress had an issue? Or not doing decompression at all?
There was a problem hiding this comment.
The latter (i.e., if the response is not compressed)
There was a problem hiding this comment.
My opinion is that the trailers should only be added if the stream was actually decompressed. So this is correct. But you did make me realize that the decode/encodeTrailers calls were not gated and that was wrong. Fixed in: 540a5ae
| // TODO: replace std::vector for std::pair. For some reason the macro is failing to build with a | ||
| // multivariate templated type. |
rojkov
left a comment
There was a problem hiding this comment.
This looks great! Just one thing to clarify.
source/extensions/filters/http/decompressor/decompressor_filter.h
Outdated
Show resolved
Hide resolved
|
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Signed-off-by: Jose Nino <jnino@lyft.com>
|
coming back to this after being completely occupied otherwise. |
Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: Jose Nino <jnino@lyft.com>
|
@dio can I get a re-review now that I updated and de-staled the PR? |
Bumping primarily to include the changes from envoyproxy/envoy#12477 for decompressor trailers reporting. Contains changes to fix compilation after: - envoyproxy/envoy@d245c02 - envoyproxy/envoy@52ec66f Also contains new fixes required by Envoy Mobile: - envoyproxy/envoy#13039 - envoyproxy/envoy#13040 Signed-off-by: Michael Rebello <me@michaelrebello.com>
Bumping primarily to include the changes from #12477 for decompressor trailers reporting. Contains changes to fix compilation after: - d245c02 - 52ec66f Also contains new fixes required by Envoy Mobile: - #13039 - #13040 Signed-off-by: Michael Rebello <me@michaelrebello.com> Signed-off-by: JP Simard <jp@jpsim.com>
Bumping primarily to include the changes from #12477 for decompressor trailers reporting. Contains changes to fix compilation after: - d245c02 - 52ec66f Also contains new fixes required by Envoy Mobile: - #13039 - #13040 Signed-off-by: Michael Rebello <me@michaelrebello.com> Signed-off-by: JP Simard <jp@jpsim.com>
Commit Message: add bytes reporting to trailers
Additional Description: it is useful for certain experiments to be aware of the compressed/uncompressed size of payloads as they go through the decompressor filter. This PR adds such details to the request/response trailers.
Risk Level: low
Testing: updated unit and integration tests
Docs Changes: updated
Release Notes: updated
Signed-off-by: Jose Nino jnino@lyft.com