question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for Source Context

See original GitHub issue

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: https://github.com/getsentry/sentry-dotnet/commit/518ab6464418cb1912ae4adad08262c440f4da42) 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: https://github.com/getsentry/sentry-dotnet/issues/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:

https://github.com/getsentry/sentry-dart/issues/132

https://github.com/getsentry/sentry-java/issues/633

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
vaindcommented, Dec 6, 2022

The second approach, i.e. sentry-cli upload-dif --include-sources is implemented by https://github.com/getsentry/symbolic/pull/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
3reactions
vaindcommented, Jan 30, 2023

Both options work now on sentry.io

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best way to enrich when source context is anything but a ...
TryGetValue("SourceContext", out var ctx) && ctx is ScalarValue sv ... If you are feeling uneasy about the magic string "SourceContext" ...
Read more >
Context Sources - Reference and Theoretical - College Writing
A guide to support the course College Writing: Writing Identity. Home · Context Sources - Reference and Theoretical.
Read more >
Error: Could not find source context #3654 - sanity-io sanity
Unfortunately I'm running into issues trying to fetch data in my nextjs application, as the useClient hook gives me the following error: Error:...
Read more >
Set the default source for search context
Set the default source for search context · Navigate to All > Contextual Search > Search Contexts. · Open the search context record...
Read more >
Source Context for Serilog
If Sentry has access to your application's source code, it can show snippets of code (source context) around the location of stack frames,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found