Skip to content

Commit

Permalink
permit exact matches of relative paths for untargeted line trace points
Browse files Browse the repository at this point in the history
  • Loading branch information
p committed Nov 18, 2024
1 parent b263157 commit fd98e77
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/datadog/di/instrumenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,11 @@ def hook_line(probe, &block)
# If trace point is not targeted, we must verify that the invocation
# is the file & line that we want, because untargeted trace points
# are invoked for *each* line of Ruby executed.
if iseq || tp.lineno == probe.line_no && probe.file_matches?(tp.path)
# TODO find out exactly when the path in trace point is relative.
# Looks like this is the case when line trace point is not targeted?
if iseq || tp.lineno == probe.line_no && (
probe.file == tp.path || probe.file_matches?(tp.path)
)
if rate_limiter.nil? || rate_limiter.allow?
# & is to stop steep complaints, block is always present here.
block&.call(probe: probe, trace_point: tp, caller_locations: caller_locations)
Expand Down

0 comments on commit fd98e77

Please sign in to comment.