Support for Source Context
See original GitHub issueThere are different approaches we can take to add support for source context:
-
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. -
Additional approach is to use Source Bundles and corresponding docs. This requires changes on Sentry CLI and the backend.
-
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:
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top GitHub Comments
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
Both options work now on sentry.io
--include-sources
flag to sentry-cli v 2.12.0 (@mattjohnsonpint maybe a follow up would be to provide this option for users of the msbuild built-in sentry-cli?) - https://sentry.io/organizations/sentry-sdks/issues/3744054261/events/e9ec13b402aa4834baea0fe3958a544a/?project=5428537<EmbedAllSources>true</EmbedAllSources>
in the project config - https://sentry.io/organizations/sentry-sdks/issues/3744250864/events/8860bd526ff44a37bca48e2562068c1b/?project=5428537