Module: Datadog::Contrib::Rake::Instrumentation::InstanceMethods

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

Overview

Instance methods for Rake instrumentation

Instance Method Summary collapse

Instance Method Details

#execute(args = nil) ⇒ Object



27
28
29
30
31
32
33
34
35
36
# File 'lib/ddtrace/contrib/rake/instrumentation.rb', line 27

def execute(args = nil)
  return super unless enabled?

  tracer.trace(Ext::SPAN_EXECUTE, span_options) do |span|
    annotate_execute!(span, args)
    super
  end
ensure
  shutdown_tracer!
end

#invoke(*args) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/ddtrace/contrib/rake/instrumentation.rb', line 16

def invoke(*args)
  return super unless enabled?

  tracer.trace(Ext::SPAN_INVOKE, span_options) do |span|
    annotate_invoke!(span, args)
    super
  end
ensure
  shutdown_tracer!
end