class ElasticAPM::Transport::Connection::Http

def open_request_in_thread(url)

def open_request_in_thread(url)
  debug '%s: Opening new request', thread_str
  Thread.new do
    begin
      resp = post(url, body: @rd, headers: @headers.chunked.to_h)
      if resp&.status == 202
        debug 'APM Server responded with status 202'
      elsif resp
        error "APM Server responded with an error:\n%p", resp.body.to_s
      end
    rescue Exception => e
      error(
        "Couldn't establish connection to APM Server:\n%p", e.inspect
      )
    end
  end
end