Module: Appsignal::Integrations::HttpIntegration

Defined in:
lib/appsignal/integrations/http.rb

Instance Method Summary collapse

Instance Method Details

#request(verb, uri, opts = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/appsignal/integrations/http.rb', line 6

def request(verb, uri, opts = {})
  parsed_request_uri = uri.is_a?(URI) ? uri : URI.parse(uri.to_s)
  request_uri = "#{parsed_request_uri.scheme}://#{parsed_request_uri.host}"

  begin
    Appsignal.instrument("request.http_rb", "#{verb.upcase} #{request_uri}") do
      super
    end
  rescue Exception => error # rubocop:disable Lint/RescueException
    Appsignal.set_error(error)
    raise error
  end
end