Module: NetworkResiliency::Adapter::HTTP::Instrumentation
- Defined in:
- lib/network_resiliency/adapter/http.rb
Instance Method Summary collapse
Instance Method Details
#connect ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/network_resiliency/adapter/http.rb', line 19 def connect return super unless NetworkResiliency.enabled?(:http) begin ts = -NetworkResiliency. super rescue Net::OpenTimeout => e # capture error raise ensure ts += NetworkResiliency. NetworkResiliency.record( adapter: "http", action: "connect", destination: address, error: e&.class, duration: ts, ) end end |