Module: Datadog::Contrib::HTTP::Instrumentation

Defined in:
lib/ddtrace/contrib/http/instrumentation.rb

Overview

Instrumentation for Net::HTTP

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Class Method Details

.after_request(&block) ⇒ Object

Span hook invoked after request is completed.



19
20
21
22
23
24
25
26
27
# File 'lib/ddtrace/contrib/http/instrumentation.rb', line 19

def self.after_request(&block)
  if block_given?
    # Set hook
    @after_request = block
  else
    # Get hook
    @after_request ||= nil
  end
end

.included(base) ⇒ Object



14
15
16
# File 'lib/ddtrace/contrib/http/instrumentation.rb', line 14

def self.included(base)
  base.send(:prepend, InstanceMethods)
end