From d880a217ab2a8b6768c3571cf1ff8959fc0fdc9a Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Mon, 26 Aug 2024 16:37:39 -0400 Subject: [PATCH] fix line probe stack traces --- lib/datadog/di/remote_processor.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/datadog/di/remote_processor.rb b/lib/datadog/di/remote_processor.rb index b5a5737b51e..af06b12896c 100644 --- a/lib/datadog/di/remote_processor.rb +++ b/lib/datadog/di/remote_processor.rb @@ -25,12 +25,14 @@ def process(config) begin if probe.line? - hook_manager.hook_line(probe.file, probe.line_nos.first) do |tp| + # TODO Test that stack trace is correct with user code being top entry + hook_manager.hook_line(probe.file, probe.line_nos.first) do |tp, callers:| puts '*** line probe executed ***' ProbeNotifier.notify_emitting(probe) - ProbeNotifier.notify_executed(probe, tracepoint: tp, callers: caller) + ProbeNotifier.notify_executed(probe, tracepoint: tp, callers: callers) end elsif probe.method? + # TODO Test that stack trace is correct with user code being top entry hook_manager.hook_method_when_defined(probe.type_name, probe.method_name) do |**opts| puts "*** method probe executed: #{opts} ***" ProbeNotifier.notify_emitting(probe)