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 5: Fix content lengths #7463

Conversation

anuragagarwal561994
Copy link
Contributor

#6747

This is referencing the above issue for Apache Http Client 5.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 before it is assigned to the request internally.

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. This is because 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 21, 2022 23:24
@anuragagarwal561994
Copy link
Contributor Author

@trask @mateuszrzeszutek, when you get time can you please review the changes.

@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