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
IgnoreMatch() Option #30
Conversation
Option to ignore stack traces that have the full substring inside it. (Can't be done in user-space because the opts struct is private.)
|
Codecov Report
@@ Coverage Diff @@
## master #30 +/- ##
==========================================
+ Coverage 95.03% 95.17% +0.13%
==========================================
Files 4 4
Lines 141 145 +4
==========================================
+ Hits 134 138 +4
Misses 4 4
Partials 3 3
Continue to review full report at Codecov.
|
Thanks for the contribution @ryanrhee Can you provide some additional context on what exactly you're trying to do? Ignore a substring match in the full stack is a pretty broad feature, typically exclusions are a little more fine-grained (based on the top function on the stack, or looking for a specific function). This sub-string match will also match filenames, which can vary across environments, which could have unexpected results. |
@prashantv ideally each stack frame would be parsed and i could match against it, but it seems such parsing isn't easily doable in the current codebase. Sub-string match will give us a reasonable way of continuing to run goleak without investing in a way to properly parse stack frames; the alternative for us would be to just stop using it, and we prefer not to do so. |
Are you trying to ignore a specific function in the call stack? Will it be the full function name, or is there a use-case for a sub-string? We can ignore the top function already, we could extend the parsing to ignore a function anywhere in the frame. It would be a little more work, but I'd prefer to make this library API safer for the long-term. We are planning to cut a 1.0 soon, after which we'll maintain the API going forward, so I want to be careful about the APIs we are adding. |
Full function name.
…On Wed, May 8, 2019 at 2:04 PM Prashant Varanasi ***@***.***> wrote:
@prashantv <https://github.com/prashantv> ideally each stack frame would
be parsed and i could match against it, but it seems such parsing isn't
easily doable in the current codebase. Sub-string match will give us a
reasonable way of continuing to run goleak without investing in a way to
properly parse stack frames; the alternative for us would be to just stop
using it, and we prefer not to do so.
Are you trying to ignore a specific function in the call stack? Will it be
the full function name, or is there a use-case for a sub-string? We can
ignore the top function already, we could extend the parsing to ignore a
function anywhere in the frame. It would be a little more work, but I'd
prefer to make this library API safer for the long-term.
We are planning to cut a 1.0 soon, after which we'll maintain the API
going forward, so I want to be careful about the APIs we are adding.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#30 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAB3G5CJGTCJAJQAY4MOOVTPUMIZ5ANCNFSM4HJ4DCKA>
.
|
I would like to be able to us this at least to ignore the eternal goroutine that glog starts up at init time. (search for init in https://github.com/golang/glog/blob/master/glog.go) |
I think extending the stack parsing code to parse the function names, and then allowing an ignore if a function shows up anywhere in the stack trace is a better API to support, rather than allowing matching against the filename which is arbitrary. I was hoping to spend some time improving the stack parsing functionality, but did not get around to it, but would appreciate any contributions on that front, thanks! |
Update: There's stack trace parsing code now, and #113 added a new IgnoreAnyFunction option to ignore a function anywhere in the stack trace. Closing this PR since ignoring a specific function was the goal here too. |
Option to ignore stack traces that have the full substring inside it.
(Can't be done in user-space because the opts struct is private.)