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

Defined in:
lib/datadog/tracing/contrib/rake/instrumentation.rb

Overview

Instance methods for Rake instrumentation

Instance Method Summary collapse

Instance Method Details

#execute(args = nil) ⇒ Object



29
30
31
32
33
34
35
36
37
38
# File 'lib/datadog/tracing/contrib/rake/instrumentation.rb', line 29

def execute(args = nil)
  return super if !enabled? || !instrumented_task?

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

#invoke(*args) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/datadog/tracing/contrib/rake/instrumentation.rb', line 18

def invoke(*args)
  return super if !enabled? || !instrumented_task?

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