Module: NetworkResiliency::Adapter::HTTP
Defined Under Namespace
Modules: Instrumentation
Constant Summary collapse
- ERRORS =
[ IOError, (OpenSSL::OpenSSLError if defined?(OpenSSL::SSL)), SocketError, SystemCallError, Timeout::Error, ].compact
- REQUEST_TIMEOUT_HEADER =
"X-Request-Timeout"- ID_REGEX =
%r{/[0-9]+(?=/|$)}.freeze
- UUID_REGEX =
%r`/\h{8}-\h{4}-(\h{4})-\h{4}-\h{12}(?=/|$)`.freeze
Instance Method Summary collapse
Instance Method Details
#patch(instance = nil) ⇒ Object
18 19 20 21 22 |
# File 'lib/network_resiliency/adapter/http.rb', line 18 def patch(instance = nil) return if patched?(instance) (instance&.singleton_class || Net::HTTP).prepend(Instrumentation) end |
#patched?(instance = nil) ⇒ Boolean
24 25 26 |
# File 'lib/network_resiliency/adapter/http.rb', line 24 def patched?(instance = nil) (instance&.singleton_class || Net::HTTP).ancestors.include?(Instrumentation) end |