Skip to content

Fix http.server.request.duration and http.server.response.duration with Transport-Encoding: chunked #4822

Description

@divergentdave

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions