Skip to content

http.rb tracer raises "HTTP::StateError: body is being streamed" on failure responses #1116

Closed

Description

Using ddtrace 0.38.0, we are seeing errors with our http.rb responses when enabling the tracer.

Tested with http.rb 4.3.0 and 4.4.1

Configuration:

Datadog.configure do |c|
  c.use :httprb,
        analytics_enabled: true,
        service_name: "http-rb-#{ENV['HEROKU_APP_NAME']}"
end

We are seeing HTTP::StateError: body is being streamed errors on failure responses such as 4xx. When inspecting the response returned by http.rb, we are seeing:

#<HTTP::Response::Body:3fc14efc16c0 @streaming=true>

Disabling the httprb trace in the configuration returns the following response:

#<HTTP::Response::Body:3ff78f899c90 @streaming=false>

This appears to only be happening on failure level status codes and is preventing us from properly parsing response bodies.

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

Metadata

Assignees

No one assigned

    Labels

    bugInvolves a bugcommunityWas opened by a community member

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions