Skip to content
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

Apache HTTP Client 4.x: Fix content lengths #7467

Conversation

anuragagarwal561994
Copy link
Contributor

#6747

This is referencing the above issue for Apache Http Client 4.x

In version 1.18.0 requestLength and responseLengths were removed and instead in general content-length header is being used.

The header doesn't really work in case of chunked encoding and for http client 5.x and even for content-length encoding the header is accessed from user-request when the header is actually appended in internal request.

The approach followed in this MR is not really concerned about the user request content-length, but mainly the bytes transferred in and out which is more or less closely equal to the content length only. We are intercepting the byte buffers, adding the bytes in / out of the buffer.

We are storing these metrics with respect to the parent context in a virtual field for async client since there is so much disconnectivity. Suggestions are welcome for an improved approach. These metrics then are collected via an attributes extractor.

@anuragagarwal561994 anuragagarwal561994 requested a review from a team December 22, 2022 22:09
@anuragagarwal561994
Copy link
Contributor Author

Merged with #6749

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant