Allow checking for functions anywhere in the stack#80
Allow checking for functions anywhere in the stack#80thomshutt wants to merge 3 commits intouber-go:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #80 +/- ##
==========================================
+ Coverage 94.92% 96.29% +1.36%
==========================================
Files 5 5
Lines 138 243 +105
==========================================
+ Hits 131 234 +103
- Misses 4 6 +2
Partials 3 3
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
👋 This has been open for a while now; if there's anything you'd like me to change then let me know. Similarly if it's not functionality that you want to add then I can close the PR. |
|
This would be useful for a more precise suppression of a goroutine in Kubernetes which is currently reported as being in |
prashantv
left a comment
There was a problem hiding this comment.
I'm +1 on adding this functionality, but don't think it should be done using strings.Contains on the raw stack.
I'd prefer if we updated the parser to understand the function names specifically, and allow matching on the function name only.
prashantv
left a comment
There was a problem hiding this comment.
Thanks for updating the parsing logic, left a couple of comments on the parser + tests.
| } | ||
|
|
||
| // AllFunctions returns the names of all functions on the stack. | ||
| func (s Stack) AllFunctions() []string { |
There was a problem hiding this comment.
can you update the tests in stacks_test.go to verify the behaviour of AllFunctions as well?
| if f := parseFunc(line); f != "" { | ||
| curStack.functions = append(curStack.functions, f) | ||
| } |
There was a problem hiding this comment.
this looks like it's trying to parse every line, should we instead parse only the lines known to be functions?
I think the format is:
<function>
<tab><file:line>
<function>
<tab><file:line>
...
| if idx := strings.LastIndex(line, "created by"); idx >= 0 { | ||
| return strings.TrimPrefix(line, "created by ") | ||
| } |
There was a problem hiding this comment.
since it's not part of the stack, may be better to skip parsing these till it's required
|
@thomshutt Any chance you're still around to address those code changes? I was just about to file an issue over lacking this functionality before I found this PR because I needed it too. |
Adds a new IgnoreAnyFunction option to ignore stacks that have the provided function anywhere in the stack, not just the top. To test this better, the helper blockedG.run function was split into two. Supersedes #80
Adds a new IgnoreAnyFunction option to ignore stacks that have the provided function anywhere in the stack, not just the top. To test this better, the helper blockedG.run function was split into two. Supersedes #80
Adds a new IgnoreAnyFunction option to ignore stacks that have the provided function anywhere in the stack, not just the top. To test this better, the helper blockedG.run function was split into two. Supersedes #80
Adds support to the stack parser for reading the full list of functions for a stack trace. NOTE: The function that created the goroutine is NOT considered part of the stack. We don't maintain the order of the functions since that's not something we need at this time. The functions are all placed in a set. This unblocks #41 and allows implementing an IgnoreAnyFunction option (similar to the stalled #80 PR). Depends on #110
Adds a new IgnoreAnyFunction option to ignore stacks that have the provided function anywhere in the stack, not just the top. To test this better, the helper blockedG.run function was split into two. Supersedes #80
Adds a new IgnoreAnyFunction option to ignore stacks that have the provided function anywhere in the stack, not just the top. To test this better, the helper blockedG.run function was split into two. Supersedes #80
|
Superseded by #113 |
No description provided.