rursprung commented on PR #906:
URL: 
https://github.com/apache/httpcomponents-client/pull/906#issuecomment-6466613481

   Thanks, you are right. `getContentLength()` is the declared entity length,
   and the OpenTelemetry `*.body.size` names are defined as transferred bytes
   (compressed if a content coding is used). I have changed the PR so that it
   no longer claims those names:
   
   - Meters renamed to `<prefix>.request.content.length` and
     `<prefix>.response.content.length`. The opt-in switch is now
     `MetricSet.CONTENT_LENGTH`, the interceptors are `ContentLengthExec` and
     `AsyncContentLengthExec`.
   - Javadoc now says these are declared, uncompressed entity lengths and not
     the number of bytes transferred.
   - Nothing is recorded any more if no response was received. The
     connection-refused test now asserts that no meter exists.
   
   Why the declared, uncompressed length is still useful: servers often limit
   the decoded request size, not the bytes on the wire. OpenSearch, for
   example, rejects requests with `413` when the decoded body exceeds
   `http.max_content_length`; the limit is checked after decompression. With
   this metric, users can see how close their (for example `_bulk`) requests
   get to that limit. Details are in the PR description.
   
   If you wish, I can add transferred body sizes under the OpenTelemetry names 
in a
   separate PR. They need a different chain position (after compression, just
   before `MAIN_TRANSPORT`) and byte counting on the data path, so I think it
   is easier to review on its own.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to