-
Notifications
You must be signed in to change notification settings - Fork 78
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
Match on process suffix instead of contains #73
Conversation
Codecov Report
@@ Coverage Diff @@
## main #73 +/- ##
=======================================
Coverage 46.82% 46.82%
=======================================
Files 15 15
Lines 1119 1119
=======================================
Hits 524 524
Misses 548 548
Partials 47 47
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just a minor comment that can be done later.
BTW the integration test failed because GRPC integration tests are flaky. I recorded an issue: #65
pkg/goexec/file.go
Outdated
@@ -51,7 +51,7 @@ func ProcessNamed(pathContains string) ProcessFinder { | |||
continue | |||
} | |||
|
|||
if strings.Contains(exePath, pathContains) { | |||
if strings.HasSuffix(exePath, pathContains) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NitPick: maybe renaming pathContains
by pathSuffix
?
Thanks Mario! I'll take a look at that grpc flakiness. |
This PR changes the name matcher for the instrumented process to look for the suffix in the full path, instead of matching a partial path. This should avoid false positives on matching the name of a process accidentally, e.g:
We shouldn't match
/server
in here/home/user/.vscode/extensions/rust-lang.rust-analyzer-0.3.1472-linux-x64/server/rust-analyzer
, but we should match it here./server