Module: NetworkResiliency::Adapter::HTTP
Defined Under Namespace
Modules: Instrumentation
Constant Summary collapse
- ERRORS =
[ Timeout::Error, IOError, SystemCallError, (OpenSSL::OpenSSLError if defined?(OpenSSL::SSL)), ].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
17 18 19 20 21 |
# File 'lib/network_resiliency/adapter/http.rb', line 17 def patch(instance = nil) return if patched?(instance) (instance&.singleton_class || Net::HTTP).prepend(Instrumentation) end |
#patched?(instance = nil) ⇒ Boolean
23 24 25 |
# File 'lib/network_resiliency/adapter/http.rb', line 23 def patched?(instance = nil) (instance&.singleton_class || Net::HTTP).ancestors.include?(Instrumentation) end |