Currently when we handle an HTTP request, we check the request and response headers for a Content-Length header, and use that to populate the http.server.request.duration and http.server.response.duration histograms. If there is no such header, we use 0 instead. This is fine for requests without a body, but it will get requests and responses using Transport-Encoding: chunked wrong. A nearby comment suggests the possibility of switching to opentelemetry-instrumentation-tower, but it looks like this has the same limitation. We may be able to address this by wrapping request and response bodies in our own type, but I haven't looked at what the constraints on the body type are.
Currently when we handle an HTTP request, we check the request and response headers for a Content-Length header, and use that to populate the
http.server.request.durationandhttp.server.response.durationhistograms. If there is no such header, we use 0 instead. This is fine for requests without a body, but it will get requests and responses using Transport-Encoding: chunked wrong. A nearby comment suggests the possibility of switching toopentelemetry-instrumentation-tower, but it looks like this has the same limitation. We may be able to address this by wrapping request and response bodies in our own type, but I haven't looked at what the constraints on the body type are.