-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DEBUG-3439 DEBUG-3440 remove prefixes from probe paths when path matching #4346
Conversation
Datadog ReportBranch report: ✅ 0 Failed, 22102 Passed, 1476 Skipped, 5m 49.63s Total Time ⌛ Performance Regressions vs Default Branch (1)
|
4c5a873
to
6d013f4
Compare
BenchmarksBenchmark execution time: 2025-02-05 14:20:24 Comparing candidate commit f5eaac9 in PR branch Found 1 performance improvements and 2 performance regressions! Performance is the same for 28 metrics, 2 unstable metrics. scenario:profiler - sample timeline=false
scenario:tracing - Propagation - Datadog
scenario:tracing - Tracing.log_correlation
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4346 +/- ##
==========================================
- Coverage 97.72% 97.71% -0.02%
==========================================
Files 1368 1368
Lines 82998 83036 +38
Branches 4220 4226 +6
==========================================
+ Hits 81113 81139 +26
- Misses 1885 1897 +12 ☔ View full report in Codecov by Sentry. |
I have now verified this PR manually against debugger-demo-ruby. |
1 similar comment
I have now verified this PR manually against debugger-demo-ruby. |
* di-worker-middleware: rubocop standard current_component does not always exist? DEBUG-3457 hack probe notifier worker starting DEBUG-3439 DEBUG-3440 remove prefixes from probe paths when path matching (#4346) Add workaround for buggy gcc warnings in our Ruby 2.7 image [🤖] Lock Dependency: https://github.com/DataDog/dd-trace-rb/actions/runs/13238622524 Update specs with new names for crashtracking tags [PROF-11306] Upgrade libdatadog dependency to 16.0.1 [NO-TICKET] Update crashtracker with libdatadog 15 breaking changes
What does this PR do?
Loosens the restrictions on path matching to also try to match prefixes of probe paths to the paths that exist at runtime.
For example, suppose at runtime we have:
/app/app/controllers/hello_controller.rb
Previously, either exact full path or suffixes of the path were accepted:
/app/app/controllers/hello_controller.rb
app/controllers/hello_controller.rb
hello_controller.rb
Now, paths that have extra subdirectories in front will also be accepted:
local/hello_controller.rb
local/controllers/hello_controller.rb
Motivation:
For projects that are stored in subdirectories in their source code repositories (e.g. monorepos), source code integration is providing a full path that has extra prefixes from the application's standpoint (and also runtime standpoint). These prefixes previously made such paths not instrumentable. With this PR, the extra prefixes will be removed to try to find a matching file.
Change log entry
Yes: loosen path matching in dynamic instrumentation
Additional Notes:
This change can cause potentially incorrect files to match if the desired file is not yet loaded.
In order to properly implement matching accounting for these extra prefixes, much more work is needed. The ideal (in my present opinion) matching algorithm is described in a comment in this diff. This PR only implements a quick fix to get Ruby DI out to customers as soon as possible.
How to test the change?
Unit tests and integration test are added.