Method: Datadog::DI::ProbeNotificationBuilder#build_executed

Defined in:
lib/datadog/di/probe_notification_builder.rb

#build_executed(probe, trace_point: nil, rv: nil, duration: nil, caller_locations: nil, args: nil, kwargs: nil, serialized_entry_args: nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Duration is in seconds.



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/datadog/di/probe_notification_builder.rb', line 42

def build_executed(probe,
  trace_point: nil, rv: nil, duration: nil, caller_locations: nil,
  args: nil, kwargs: nil, serialized_entry_args: nil)
  snapshot = if probe.line? && probe.capture_snapshot?
    if trace_point.nil?
      raise "Cannot create snapshot because there is no trace point"
    end
    get_local_variables(trace_point)
  end
  # TODO check how many stack frames we should be keeping/sending,
  # this should be all frames for enriched probes and no frames for
  # non-enriched probes?
  build_snapshot(probe, rv: rv, snapshot: snapshot,
    # Actual path of the instrumented file.
    path: trace_point&.path,
    duration: duration, caller_locations: caller_locations, args: args, kwargs: kwargs,
    serialized_entry_args: serialized_entry_args)
end