class HTTP::Features::Instrumentation


.get(“example.com/”)
.use(instrumentation: {instrumenter: ActiveSupport::Notifications})
HTTP
Be sure to specify the instrumenter when enabling the feature:
Emits a single event like ‘“request.{namespace}”`, eg `“request.http”`.
namespace of ’http’ which may be overridden with a ‘:namespace` param.
ActiveSupport::Notifications-compatible instrumenter. Defaults to use a
Instrument requests and responses. Expects an

def initialize(instrumenter: NullInstrumenter.new, namespace: "http")

def initialize(instrumenter: NullInstrumenter.new, namespace: "http")
  @instrumenter = instrumenter
  @name = "request.#{namespace}"
end

def wrap_request(request)

def wrap_request(request)
  instrumenter.instrument("start_#{name}", :request => request)
  instrumenter.start(name, :request => request)
  request
end

def wrap_response(response)

def wrap_response(response)
  instrumenter.finish(name, :response => response)
  response
end