Skip to content
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

fix(stacktrace): Correctly report package names and ignore subpackages #127

Merged
merged 2 commits into from
Dec 20, 2019

Conversation

rhcarvalho
Copy link
Contributor

@rhcarvalho rhcarvalho commented Dec 18, 2019

Makes function receivers part of the function name and not part of the package name.

Add tests and fix filteredFrames to ensure it ignores all packages related to the SDK.

Fixes #126.

untitaker
untitaker previously approved these changes Dec 18, 2019
stacktrace.go Outdated Show resolved Hide resolved
// packageName returns the package part of the symbol name, or the empty string
// if there is none.
// It replicates https://golang.org/pkg/debug/gosym/#Sym.PackageName, avoiding a
// dependency on debug/gosym.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentional, because:

  1. https://go-proverbs.github.io, "A little copying is better than a little dependency."
  2. Avoids increasing the size of binaries that include the SDK (see Big distribution size of sentry-go (~ 8MB) #75)

stacktrace.go Outdated Show resolved Hide resolved
Makes function receivers part of the function name and not part of the
package name.
Compared to release v0.3.1, now filteredFrames compares the frame.Module
value instead of frame.AbsPath, and ignores SDK "_test" packages instead
of pattern matching test files and examples.

However confusing it might be, frame.Module holds a package name,
unrelated to Go Modules.

This fixes up the regression introduced in
61d7ccc, which caused frames from
integrations/subpackages to be reported to Sentry.
@rhcarvalho rhcarvalho force-pushed the deconstruct-function-name branch from 068b461 to bf38760 Compare December 20, 2019 09:26
@rhcarvalho rhcarvalho changed the title fix(stacktrace): Correctly report package names fix(stacktrace): Correctly report package names and ignore sub packages Dec 20, 2019
@rhcarvalho rhcarvalho changed the title fix(stacktrace): Correctly report package names and ignore sub packages fix(stacktrace): Correctly report package names and ignore subpackages Dec 20, 2019
@rhcarvalho rhcarvalho requested a review from untitaker December 20, 2019 09:32
@rhcarvalho rhcarvalho merged commit 2b1cc39 into getsentry:master Dec 20, 2019
@rhcarvalho rhcarvalho deleted the deconstruct-function-name branch December 20, 2019 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stacktrace: deconstructFunctionName returns bad output for methods
2 participants