Skip to content

docs(godot): Document C#/.NET support#18295

Open
limbonaut wants to merge 18 commits into
masterfrom
docs/godot-csharp-dotnet-support
Open

docs(godot): Document C#/.NET support#18295
limbonaut wants to merge 18 commits into
masterfrom
docs/godot-csharp-dotnet-support

Conversation

@limbonaut

@limbonaut limbonaut commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

DESCRIBE YOUR PR

Documents the Godot SDK's C#/.NET support, available in the upcoming 2.0.0 release.

  • Add a dedicated C#/.NET Support page covering setup, initialization, the Sentry.Godot.SentrySdk API, how the native and .NET layers stay in sync, and current limitations.
  • Add GDScript/C# code tabs to the shared Godot snippet includes (usage, enriching events, configuration, sensitive data) so C# examples appear across the docs.
  • Document C# (managed code) stack trace symbolication on the Readable Stack Traces page.

Tracking issue: getsentry/sentry-godot#752

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

EXTRA RESOURCES

Add documentation for the Godot SDK's C#/.NET support (available in 2.0.0). Introduce a dedicated "C#/.NET Support" page covering setup, initialization, the Sentry.Godot.SentrySdk API, how the native and .NET layers stay in sync, and current limitations.

Add GDScript/C# code tabs to the shared snippet includes (usage, enriching events, configuration, sensitive data) so C# examples appear across the Godot docs, and document managed-code stack trace symbolication on the stack traces page.

Refs getsentry/sentry-godot#752
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sentry-docs Ready Ready Preview, Comment Jun 9, 2026 2:18pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
develop-docs Ignored Ignored Preview Jun 9, 2026 2:18pm

Request Review

@JoshuaMoelans JoshuaMoelans left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice. LGTM!

@limbonaut

Copy link
Copy Markdown
Collaborator Author

Missed a bunch of samples, let me add them to this PR.

@codeowner-assignment codeowner-assignment Bot requested a review from a team June 8, 2026 17:12
@limbonaut limbonaut requested a review from JoshuaMoelans June 8, 2026 17:12
@limbonaut

Copy link
Copy Markdown
Collaborator Author

All the code samples I checked and verified with dotnet build.

Comment thread docs/platforms/godot/dotnet/index.mdx Outdated
@JoshuaMoelans

Copy link
Copy Markdown
Member

@codeowner-assignment codeowner-assignment Bot requested a review from a team June 9, 2026 09:34

@jared-outpost jared-outpost Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good work overall — the C# additions are technically accurate and well-structured. A few issues worth addressing before merge.

Functional issues

  1. dotnet/index.mdxIpAddress sentinel value is wrong.
    In enriching-events/set-user/godot.mdx you correctly use "{{auto}}", but in dotnet/index.mdx (Set the User and Tags section) the C# example doesn't show IpAddress at all. That's fine, but a comment or note that IpAddress = "{{auto}}" infers the IP would help — the GDScript side calls user.infer_ip_address() explicitly.

  2. unset-user/godot.mdx — resetting the user with new SentryUser() is incorrect.
    An empty SentryUser object is not the same as removing the user. The correct call is scope.User = null (or SentrySdk.ConfigureScope(scope => scope.User = null)). Setting an empty user object may still report a user record to Sentry.

  3. metrics/usage/godot.mdx — the Alert about SetBeforeSendMetric being the only way to add global attributes is inaccurate for the common case.
    The before_send_metric hook isn't a close equivalent to set_attribute — it runs per-metric and applies attributes on the way out, it doesn't set them on the scope. The Alert text says "it applies attributes to every log" but this is in the metrics section, not the logs section. Fix the copy: it applies to every metric, not every log.

Minor style/clarity issues

  1. dotnet/index.mdx — headline "Use the SDK in C#" is followed immediately by the sub-headline "Capture an Exception" with no prose between them.
    The style guide requires text between consecutive headings. Add a sentence introducing what the following subsections cover.

  2. dotnet/index.mdxoptions.Release = "my-game@{app_version}"; uses a placeholder that looks like a C# format string.
    The {app_version} placeholder is ambiguous — it reads like a C# string interpolation hole but it's actually a Sentry template. Either escape it clearly or replace with a concrete string like "my-game@2.0.0" in the Verify section. The same pattern appears in the Manual Initialization snippet ("my-game@{app_version}", "{auto}").

  3. dotnet/index.mdx — "Don't call Sentry.SentrySdk..." alert uses passive voice.
    "It skips Godot-specific initialization" — fine. But "The bundled analyzer flags this" could be "The bundled Roslyn analyzer flags this with a warning" to be more precise (already says SENTRYGD1001, so this is a minor quibble).

  4. options.mdx — the Alert for before_capture_screenshot uses title="Note".
    Sentry docs style uses <Alert> without a title for a plain informational note, or a specific level like level="warning". A title of "Note" is redundant with the component itself.

Nit

  1. stack-traces.mdx — "What you need to do depends on the platform" is passive/wordy.
    Could be "The steps vary by platform:" — shorter and more direct.

The new dotnet/index.mdx page is well-organized and the two-layer sync explanation is clear and useful. The code tab additions across the platform includes are consistent and correct (tabs, {mdExpandTabs}, etc.). Items 2 and 3 above are the ones that could mislead users.

@jared-outpost jared-outpost Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good work overall — the C#/.NET page is well-structured, the code examples are clean, and the scope-sync/trace-linking explanations are clear. A few things to tighten up:

docs/platforms/godot/dotnet/index.mdx

  • The {app_version} / {auto} placeholders in the manual-init example look like Sentry token syntax, but they aren't — they won't be substituted at runtime. If these are meant as literal strings the user replaces, use <your-app-version> / <your-environment> or add a comment.
  • "Initializing Sentry from either language brings up both layers" — "brings up" is a bit informal; prefer "initializes both layers."
  • The SentryGodotOptions paragraph says "which extends the .NET SDK's SentryOptions with Godot-specific settings such as AttachLog, AttachSceneTree, and AttachScreenshot" but the preceding init example doesn't use SentryGodotOptions — the options lambda parameter appears to be a plain SentryOptions. Either update the example to use SentryGodotOptions (if that's the correct type for the callback) or clarify where SentryGodotOptions is used.
  • "Don't enable session tracking in C# — it would double-count sessions." — good warning, but worth making it an <Alert level="warning"> block so it stands out.

docs/platforms/godot/configuration/stack-traces.mdx

  • "No upload is required if you ship debug symbols with your game. The SDK then resolves file names and line numbers at runtime from the .pdb files next to your game" — this implies PDB resolution happens inside the SDK; in practice it's the .NET runtime / System.Diagnostics. Minor but worth being precise: "the .NET runtime resolves file names and line numbers from the .pdb files shipped alongside your game."

platform-includes/logs/usage/godot.mdx

  • The C# "global attributes" example uses SetBeforeSendLog as the equivalent of set_attribute, and the <Alert> says "The C# SDK doesn't have a scope-level attribute API yet." The same pattern and alert appear again in platform-includes/metrics/usage/godot.mdx with a copy-paste bug: the metrics alert reads "it applies attributes to every log" instead of "every metric."

platform-includes/enriching-events/set-user/godot.mdx

  • IpAddress = "{{auto}}" — double-brace syntax is GDScript-flavored; the .NET SDK uses "{{auto}}" as a literal sentinel string too, so this is technically correct, but a comment like // tells Sentry to infer the IP would help readers who don't already know the convention.

Minor nits

  • Several new C# snippets use SentrySdk.ConfigureScope(scope => scope.User = new SentryUser()); to unset the user. Readers may not realize this replaces the user with an empty object rather than clearing it. If SentrySdk.ConfigureScope(scope => scope.User = null); is valid in this SDK version, that's clearer intent.
  • Trailing comma after the last dictionary entry in the breadcrumbs-example C# snippet (["spawn_point"] = "forest",) — fine in C#, just noting it's intentional and not a bug.

@jared-outpost jared-outpost Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed the C#/.NET docs addition. The content is clear, well-structured, and technically accurate. One small copy-paste issue to fix:

In platform-includes/metrics/usage/godot.mdx, the Alert under Global Attributes reads:

it applies attributes to every log.

But this is in the metrics section — should be "every metric".

Everything else looks good: the two-layer sync explanation is clear, the limitations section is honest about current gaps, the symbolication instructions per-platform are correct, and the {mdExpandTabs} flags are applied correctly throughout (GDScript vs. C# tabs are genuinely too different for an LLM to infer one from the other).

jared-outpost[bot]

This comment was marked as duplicate.

@jared-outpost

This comment was marked as duplicate.

jared-outpost[bot]

This comment was marked as duplicate.

jared-outpost[bot]

This comment was marked as duplicate.

@JoshuaMoelans JoshuaMoelans left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🚀

@codeowner-assignment codeowner-assignment Bot requested a review from a team June 9, 2026 10:52
@limbonaut

Copy link
Copy Markdown
Collaborator Author

Sorry for all the continued additions, team 😅
Looks like my initial PR was quite under-cooked. I'll take one more look after Vercel deploys, if any adjustments needed.

Comment thread docs/platforms/godot/enriching-events/attachments/index.mdx Outdated

@JoshuaMoelans JoshuaMoelans left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

very small remark about rewording a sentence (either comment resolves the other 😅 )

Comment thread platform-includes/configuration/config-intro/godot.mdx Outdated
Comment thread platform-includes/configuration/config-intro/godot.mdx Outdated
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.

3 participants