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

Defined in:
lib/datadog/tracing/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/datadog/tracing/contrib/http/instrumentation.rb', line 19

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

.included(base) ⇒ Object



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

def self.included(base)
  base.prepend(InstanceMethods)
end