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

Support for Source Context #646

Closed
Tracked by #42
bruno-garcia opened this issue Dec 10, 2020 · 9 comments
Closed
Tracked by #42

Support for Source Context #646

bruno-garcia opened this issue Dec 10, 2020 · 9 comments
Labels
Feature New feature or request

Comments

@bruno-garcia
Copy link
Member

bruno-garcia commented Dec 10, 2020

There are different approaches we can take to add support for source context:

  1. It's possible to embed sources in the pdb. Couldn't find docs but general GitHub issues. Seems the property is <Embed>true</Embed>.
    With this approach we can document this on docs.sentry.io and suggest users opt-in. And read the source when capturing the SDK (opt-in at first, with the goal of making it opt-out). With the source embedded, we can read it at runtime (see this commit: 518ab64) and send it with the event.

  2. Additional approach is to use Source Bundles and corresponding docs. This requires changes on Sentry CLI and the backend.

  3. Yet another way is to support sourcelink on the server by fetching the external VCS repository to get the relevant line numbers. Related: When sourcelink data is available send with event #400 It also requires changes on the backend but can help us show source context for external, .NET libraries which commonly use sourcelink (.NET itself uses it).

Related:

getsentry/sentry-dart#132

getsentry/sentry-java#633

@bruno-garcia bruno-garcia added Feature New feature or request Up-For-Grabs labels Dec 10, 2020
@bruno-garcia bruno-garcia changed the title Read SourceContext from the client when source available in PDB Support for Source Context Apr 26, 2022
@bruno-garcia
Copy link
Member Author

bruno-garcia commented Jun 24, 2022

We could use mvid to be the identifier of the source bundle.
https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/cli/
https://getsentry.github.io/symbolicator/advanced/source-bundles/

@Swatinem said:

what it expects is obviously a stack trace (with a bunch of instruction_addr which might as well be completely bogus), and a debug_meta.images that have a UUID that we use for lookup

@Swatinem
Copy link
Member

@ashwoods lets make this a proper initiative so we can design this properly.
I don’t really want people to "fake" native-looking events just to get source context ;-)

@vaind
Copy link
Collaborator

vaind commented Nov 30, 2022

Adding <EmbedAllSources>true</EmbedAllSources> to the project includes sources in the generated PDB. I've uploaded that to sentry & tested with the customized console app sample but there are no sources displayed on the sentry.io event.

I guess there's something that need to change on the server @Swatinem ?

@Swatinem
Copy link
Member

Well, yes :-)

Sources embedded in the Portable PDB are not implemented at all. We would need to add support for that on the server side.

I don’t think you can create a sentry "source bundle" directly from portable pdb files currently.

Using the source embedded in the Portable PDB might be interesting, then you wouldn’t need a separate file either.

@vaind
Copy link
Collaborator

vaind commented Nov 30, 2022

Mind creating an issue in the appropriate repo so that it's tracked and eventually prioritized? I guess you'd be able to best describe what's needed.

@Swatinem
Copy link
Member

Swatinem commented Dec 1, 2022

Here it is: getsentry/symbolic#725
I will defer prioritization to @ashwoods

@vaind
Copy link
Collaborator

vaind commented Dec 6, 2022

The second approach, i.e. sentry-cli upload-dif --include-sources is implemented by getsentry/symbolic#729 and will be available once that makes its way to a sentry-cli release.

Tested manually on a local copy & the #2050 branch - works fine: https://sentry.io/organizations/sentry-sdks/issues/3744250864/events/9507e239323340909c12049cc24e7cf3/?project=5428537

image

@vaind
Copy link
Collaborator

vaind commented Jan 29, 2023

Symbolicator PR: getsentry/symbolicator#996 - deployed to sentry.io on 2023-30-01
Sentry CLI PR: getsentry/sentry-cli#1440 ... released in SentryCLI v2.12

@vaind
Copy link
Collaborator

vaind commented Jan 30, 2023

Both options work now on sentry.io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request
Projects
Archived in project
Development

No branches or pull requests

5 participants