From e5625605428311ea37fc9b881afdffd8b0185db0 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Fri, 12 Jun 2026 19:34:42 +0200 Subject: [PATCH 1/4] docs(godot): Add Source Context page for script frames Sentry can now fetch source on demand from a connected SCM integration and display it around stack trace frames. For GDScript this previously required exporting projects with scripts as text. Document both options for GDScript and C#, including res:// code mapping guidance, and cross-link from the Readable Stack Traces page, which keeps covering native (C/C++) frames. Co-Authored-By: Claude Fable 5 --- .../godot/configuration/source-context.mdx | 39 +++++++++++++++++++ .../godot/configuration/stack-traces.mdx | 6 +++ 2 files changed, 45 insertions(+) create mode 100644 docs/platforms/godot/configuration/source-context.mdx diff --git a/docs/platforms/godot/configuration/source-context.mdx b/docs/platforms/godot/configuration/source-context.mdx new file mode 100644 index 0000000000000..576bffdac8a7e --- /dev/null +++ b/docs/platforms/godot/configuration/source-context.mdx @@ -0,0 +1,39 @@ +--- +title: Source Context +description: "Learn how to see source code around each stack trace frame in Sentry." +--- + +Source context shows the lines of code around each frame in a stack trace, so you can spot the failing code right in Sentry without opening your project. + +Source context works for frames in any language — GDScript, C#, and native (C/C++) code — as long as the frame carries a file path and line number. For native frames, that means symbolication first; see [Readable Stack Traces](/platforms/godot/configuration/stack-traces/). + +When you run your project from the editor, the SDK reads GDScript source straight from disk and includes it with each event automatically. Exported builds are a different story: by default, Godot exports GDScript as compressed binary tokens, stripping the source the SDK needs. You have two ways to get source context for exported games — fetching source from your repository (any language) or embedding it in events (GDScript only). + +## Fetching Source From Your Repository + +Sentry can fetch source on demand from a connected source code management (SCM) integration, such as [GitHub](/integrations/source-code-mgmt/github/), and display it next to each stack trace frame. Your source stays out of the exported game — Sentry reads it straight from your repository. + +To set it up: + +1. Install a [supported SCM integration](/integrations/source-code-mgmt/source-context/#prerequisites) for your Sentry organization. +2. Add a code mapping for your project — see [Stack Trace Linking](/integrations/source-code-mgmt/github/#stack-trace-linking) for the full walkthrough. + - GDScript frames reference scripts by their `res://` path, so set the **Stack Trace Root** to `res://` and the **Source Code Root** to the repository directory containing your `project.godot` — for example, `project/` if your Godot project lives in the `project` folder, or leave it empty if it sits at the repository root. + - C# and native frames use regular file paths, so map them with their own code mappings based on the paths you see in your stack traces. +3. Turn on **Enable SCM Source Context** under your project's **Settings > General Settings > Client Security**. + +Sentry fetches each file at the commit associated with the event's release, falling back to the code mapping's default branch. For details on how fetching works, who can view the fetched source, and its limitations, see [SCM Source Context Fetching](/integrations/source-code-mgmt/source-context/). + +## Embedding Source Context in Events + +If you'd rather not connect an SCM integration, the SDK can embed GDScript source context directly in the events it sends — but only if your scripts are exported as text. In the **Export** dialog, open the **Scripts** tab of your export preset and set **GDScript Export Mode** to **Text**. + +Events then carry the source lines around each frame (up to 5 lines before and after). The trade-off: your GDScript source is distributed in plain text inside the exported project PCK file. + +## Troubleshooting + +If frames show no source context with SCM fetching, check that: + +- For GDScript frames, the code mapping's stack trace root is `res://` and its source root points to the directory containing `project.godot` in your repository. +- **Enable SCM Source Context** is turned on in your project settings. +- The SCM integration is installed and has access to the repository. +- The event is associated with a release whose commit Sentry can resolve — otherwise Sentry falls back to the default branch, which may not match the shipped code. diff --git a/docs/platforms/godot/configuration/stack-traces.mdx b/docs/platforms/godot/configuration/stack-traces.mdx index ee675bc2646c9..bda9374faef3b 100644 --- a/docs/platforms/godot/configuration/stack-traces.mdx +++ b/docs/platforms/godot/configuration/stack-traces.mdx @@ -10,6 +10,12 @@ og_image: /og-images/platforms-godot-configuration-stack-traces.png Debug information files allow Sentry to extract stack traces and provide additional information from crash reports. In order to get stack traces that contain function names, line numbers and file paths, Sentry needs to have these debug information files available when processing the crash dumps. For that, you need to export your Godot project using an export template that contains debug information. + + +This guide covers native engine and GDExtension (C/C++) code. To see GDScript source around stack trace frames, check out [Source Context](/platforms/godot/configuration/source-context/). + + + ## Prerequisites To get debug information, we need to compile export templates with debug symbols produced. You'll need Git, SCons build tool, Python, and a C++ compiler for your target platform installed. From 8a98667dc7a7209feb8d35784c7243abbea6a218 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Fri, 12 Jun 2026 20:00:55 +0200 Subject: [PATCH 2/4] docs(godot): Clarify per-language source context options Move the language-scope claim into the SCM fetching section where it applies, clarify that native frames require symbolication to carry file paths and line numbers, tell the story from the C# perspective, and document source bundle uploads for compiled code (C# and native). Co-Authored-By: Claude Fable 5 --- .../platforms/godot/configuration/source-context.mdx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/platforms/godot/configuration/source-context.mdx b/docs/platforms/godot/configuration/source-context.mdx index 576bffdac8a7e..ab090cee25b22 100644 --- a/docs/platforms/godot/configuration/source-context.mdx +++ b/docs/platforms/godot/configuration/source-context.mdx @@ -5,14 +5,16 @@ description: "Learn how to see source code around each stack trace frame in Sent Source context shows the lines of code around each frame in a stack trace, so you can spot the failing code right in Sentry without opening your project. -Source context works for frames in any language — GDScript, C#, and native (C/C++) code — as long as the frame carries a file path and line number. For native frames, that means symbolication first; see [Readable Stack Traces](/platforms/godot/configuration/stack-traces/). +When you run your project from the editor, the SDK reads GDScript source straight from disk and includes it with each event automatically. Exported builds are a different story: by default, Godot exports GDScript as compressed binary tokens, stripping the source the SDK needs. You have three ways to get source context for exported games — fetching source from your repository (any language), embedding it in events (GDScript only), or uploading source bundles (C# and native only). -When you run your project from the editor, the SDK reads GDScript source straight from disk and includes it with each event automatically. Exported builds are a different story: by default, Godot exports GDScript as compressed binary tokens, stripping the source the SDK needs. You have two ways to get source context for exported games — fetching source from your repository (any language) or embedding it in events (GDScript only). +For C#, embedding isn't an option: scripts are compiled, so the SDK can't read their source at capture time. C# frames get their file paths and line numbers from debug symbols, as covered in [Readable Stack Traces](/platforms/godot/configuration/stack-traces/#c-managed-code), and source context comes from your repository or from uploaded source bundles. ## Fetching Source From Your Repository Sentry can fetch source on demand from a connected source code management (SCM) integration, such as [GitHub](/integrations/source-code-mgmt/github/), and display it next to each stack trace frame. Your source stays out of the exported game — Sentry reads it straight from your repository. +This works for frames in any language — GDScript, C#, and native (C/C++) code — as long as they carry a file path and line number. Native frames require symbolication to get those — see [Readable Stack Traces](/platforms/godot/configuration/stack-traces/). + To set it up: 1. Install a [supported SCM integration](/integrations/source-code-mgmt/source-context/#prerequisites) for your Sentry organization. @@ -29,6 +31,12 @@ If you'd rather not connect an SCM integration, the SDK can embed GDScript sourc Events then carry the source lines around each frame (up to 5 lines before and after). The trade-off: your GDScript source is distributed in plain text inside the exported project PCK file. +## Uploading Source Bundles + +Compiled code — C# and native — can get source context without an SCM connection: `sentry-cli` can scan your debug files for source references, bundle the referenced files, and upload them alongside the debug files. Add `--include-sources` to your `sentry-cli debug-files upload` commands — the native upload in [Readable Stack Traces](/platforms/godot/configuration/stack-traces/#uploading-debug-symbols) already includes it. See [Creating Source Bundles](/cli/dif/#creating-source-bundles) for details. + +This doesn't work for GDScript, which has no debug information files. + ## Troubleshooting If frames show no source context with SCM fetching, check that: From 24c110d532129aed7800563f039541c401b503cb Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Fri, 12 Jun 2026 20:18:57 +0200 Subject: [PATCH 3/4] docs(godot): Include C# in Readable Stack Traces scope note MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The guide covers compiled code — native engine, GDExtension (C/C++), and C# — so the cross-link Alert shouldn't omit managed code. --- docs/platforms/godot/configuration/stack-traces.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/godot/configuration/stack-traces.mdx b/docs/platforms/godot/configuration/stack-traces.mdx index bda9374faef3b..0bd25547273c3 100644 --- a/docs/platforms/godot/configuration/stack-traces.mdx +++ b/docs/platforms/godot/configuration/stack-traces.mdx @@ -12,7 +12,7 @@ Debug information files allow Sentry to extract stack traces and provide additio -This guide covers native engine and GDExtension (C/C++) code. To see GDScript source around stack trace frames, check out [Source Context](/platforms/godot/configuration/source-context/). +This guide covers compiled code — the native engine, GDExtension (C/C++), and C#. To see GDScript source around stack trace frames, check out [Source Context](/platforms/godot/configuration/source-context/). From b7f024e303f39dc50b9fda97a73ece21678ae328 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Fri, 12 Jun 2026 20:27:28 +0200 Subject: [PATCH 4/4] Corrections --- docs/platforms/godot/configuration/source-context.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/platforms/godot/configuration/source-context.mdx b/docs/platforms/godot/configuration/source-context.mdx index ab090cee25b22..973ad532ace62 100644 --- a/docs/platforms/godot/configuration/source-context.mdx +++ b/docs/platforms/godot/configuration/source-context.mdx @@ -11,7 +11,7 @@ For C#, embedding isn't an option: scripts are compiled, so the SDK can't read t ## Fetching Source From Your Repository -Sentry can fetch source on demand from a connected source code management (SCM) integration, such as [GitHub](/integrations/source-code-mgmt/github/), and display it next to each stack trace frame. Your source stays out of the exported game — Sentry reads it straight from your repository. +Sentry can fetch source on demand from a connected source code management (SCM) integration, such as [GitHub](/integrations/source-code-mgmt/github/), and display it next to each stack trace frame — no need to bundle your scripts as plain text. This works for frames in any language — GDScript, C#, and native (C/C++) code — as long as they carry a file path and line number. Native frames require symbolication to get those — see [Readable Stack Traces](/platforms/godot/configuration/stack-traces/). @@ -29,7 +29,7 @@ Sentry fetches each file at the commit associated with the event's release, fall If you'd rather not connect an SCM integration, the SDK can embed GDScript source context directly in the events it sends — but only if your scripts are exported as text. In the **Export** dialog, open the **Scripts** tab of your export preset and set **GDScript Export Mode** to **Text**. -Events then carry the source lines around each frame (up to 5 lines before and after). The trade-off: your GDScript source is distributed in plain text inside the exported project PCK file. +Events then carry the source lines around each frame (up to 5 lines before and after). The trade-off: your scripts are bundled in plain text inside the exported project PCK file. ## Uploading Source Bundles