Sha256: 45ea5abb0f3b91f77786d1046549e69e96313c9dd89b6aac1b16d27732ab2179
Contents?: true
Size: 720 Bytes
Versions: 38
Compression:
Stored size: 720 Bytes
Contents
require "net/http" module Appsignal class Hooks # @api private class NetHttpHook < Appsignal::Hooks::Hook register :net_http def dependencies_present? Appsignal.config && Appsignal.config[:instrument_net_http] end def install Net::HTTP.class_eval do alias request_without_appsignal request def request(request, body = nil, &block) Appsignal.instrument( "request.net_http", "#{request.method} #{use_ssl? ? "https" : "http"}://#{request["host"] || address}" ) do request_without_appsignal(request, body, &block) end end end end end end end
Version data entries
38 entries across 38 versions & 1 rubygems