feat(skills-next): add dotnet SDK references#240
Conversation
| var ctx = SentrySdk.ContinueTrace(envelope.SentryTrace, envelope.Baggage); | ||
| var transaction = SentrySdk.StartTransaction(ctx, "process-order", "function"); |
There was a problem hiding this comment.
Bug: The documentation uses a three-argument SentrySdk.StartTransaction(ctx, "name", "op") overload that doesn't exist. The correct method takes a single TransactionContext argument.
Severity: MEDIUM
Suggested Fix
Update the code examples to use the correct single-argument overload SentrySdk.StartTransaction(ctx). The TransactionContext object ctx returned from SentrySdk.ContinueTrace already contains the necessary transaction name and operation.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: skills-next/references/sdks/dotnet/tracing.md#L407-L408
Potential issue: The documentation for .NET tracing contains incorrect code examples for
`SentrySdk.StartTransaction`. In the consumer queue example and the quick reference
cheat sheet, it shows a three-argument overload `SentrySdk.StartTransaction(ctx, "name",
"op")`. However, the Sentry .NET SDK does not have this overload. The correct usage,
shown elsewhere in the document, is to pass a single `TransactionContext` object, like
`SentrySdk.StartTransaction(ctx)`. Developers copying the incorrect examples will
encounter a compile error.
Also affects:
skills-next/references/sdks/dotnet/tracing.md:844~845
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
that's right
We do not expose an overload that has three string parameters.
There is an overload, thought, that takes a ITransactionContext and then two string.
| | Stack traces show no file/line | PDB files not uploaded | Add `SentryUploadSymbols=true` to `.csproj`; set `SENTRY_AUTH_TOKEN` in CI | | ||
| | WPF/WinForms exceptions missing | `IsGlobalModeEnabled` not set | Set `options.IsGlobalModeEnabled = true` in `SentrySdk.Init()` | |
There was a problem hiding this comment.
Bug: The index.md file contains incorrect relative paths to documentation files, which will likely cause them to fail to load.
Severity: MEDIUM
Suggested Fix
Update the paths in index.md to correctly point to the documentation files. The paths should be relative to the index.md file's location, such as error-monitoring.md, or use a variable like ${SKILL_ROOT} if the system supports it.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: skills-next/references/sdks/dotnet/index.md#L578-L579
Potential issue: The `index.md` file uses hardcoded relative paths to link to other
documentation files, such as `references/error-monitoring.md`. However, the actual files
are located at a different path, `references/sdks/dotnet/error-monitoring.md`. These
incorrect paths will likely prevent the AI system that consumes these files from loading
the reference documents, as the links will not resolve correctly within the project's
file structure.
Did we get this right? 👍 / 👎 to inform future reviews.
| | Type | C# keyword | Supported | | ||
| |------|-----------|-----------| | ||
| | `System.Byte` | `byte` | ✅ Yes | | ||
| | `System.Int16` | `short` | ✅ Yes | | ||
| | `System.Int32` | `int` | ✅ Yes | | ||
| | `System.Int64` | `long` | ✅ Yes | | ||
| | `System.Single` | `float` | ✅ Yes | | ||
| | `System.Double` | `double` | ✅ Yes | | ||
| | `System.UInt32` | `uint` | ❌ No | | ||
| | `System.UInt64` | `ulong` | ❌ No | | ||
| | `System.Decimal` | `decimal` | ❌ No | | ||
| | `System.Int128` | `Int128` | ❌ No | |
There was a problem hiding this comment.
suggestion: focus on types with keyword
This list is a bit "incomplete" / "inconsistent":
- It does not mention all integral types with a keyword:
sbyte,ushort,nint,nuint - It mentions only one integral type without a keyword (
Int128), but what aboutSystem.UInt128, andSystem.Half(a floating-point type without a keyword).
I suggest mentioning all numeric types that have a keyword, but excluding native integers, so we list the most common numeric types.
| | Type | C# keyword | Supported | | |
| |------|-----------|-----------| | |
| | `System.Byte` | `byte` | ✅ Yes | | |
| | `System.Int16` | `short` | ✅ Yes | | |
| | `System.Int32` | `int` | ✅ Yes | | |
| | `System.Int64` | `long` | ✅ Yes | | |
| | `System.Single` | `float` | ✅ Yes | | |
| | `System.Double` | `double` | ✅ Yes | | |
| | `System.UInt32` | `uint` | ❌ No | | |
| | `System.UInt64` | `ulong` | ❌ No | | |
| | `System.Decimal` | `decimal` | ❌ No | | |
| | `System.Int128` | `Int128` | ❌ No | | |
| | Type | C# keyword | Supported | | |
| |------|-----------|-----------| | |
| | `System.Byte` | `byte` | ✅ Yes | | |
| | `System.Int16` | `short` | ✅ Yes | | |
| | `System.Int32` | `int` | ✅ Yes | | |
| | `System.Int64` | `long` | ✅ Yes | | |
| | `System.Single` | `float` | ✅ Yes | | |
| | `System.Double` | `double` | ✅ Yes | | |
| | `System.SByte` | `sbyte` | ❌ No | | |
| | `System.UInt16` | `ushort` | ❌ No | | |
| | `System.UInt32` | `uint` | ❌ No | | |
| | `System.UInt64` | `ulong` | ❌ No | | |
| | `System.Decimal` | `decimal` | ❌ No | |
- removes
Int128 - adds
System.SByte - adds
System.UInt16
| // Signature | ||
| SentryId CaptureCheckIn( | ||
| string monitorSlug, | ||
| CheckInStatus status, | ||
| SentryId? checkInId = null, | ||
| TimeSpan? duration = null, | ||
| Action<SentryMonitorOptions>? configureMonitorOptions = null | ||
| ) |
There was a problem hiding this comment.
issue: API is wrong
| // Signature | |
| SentryId CaptureCheckIn( | |
| string monitorSlug, | |
| CheckInStatus status, | |
| SentryId? checkInId = null, | |
| TimeSpan? duration = null, | |
| Action<SentryMonitorOptions>? configureMonitorOptions = null | |
| ) | |
| // Signature | |
| SentryId CaptureCheckIn( | |
| string monitorSlug, | |
| CheckInStatus status, | |
| SentryId? sentryId = null, | |
| TimeSpan? duration = null, | |
| Scope? scope = null, | |
| Action<SentryMonitorOptions>? configureMonitorOptions = null | |
| ) |
- parameter
SentryIdhas wrong name - parameter
Scopemissing
| options.Schedule = "0 2 * * *"; // 2 AM daily (crontab expression) | ||
| options.CheckInMargin = 5; // 5 min grace period before "missed" | ||
| options.MaxRuntime = 30; // alert if running longer than 30 min | ||
| options.TimeZone = "America/New_York"; // IANA timezone | ||
| options.FailureIssueThreshold = 2; // create issue after 2 consecutive failures | ||
| options.RecoveryThreshold = 1; // resolve issue after 1 consecutive success |
There was a problem hiding this comment.
issue: example does not compile
| options.Schedule = "0 2 * * *"; // 2 AM daily (crontab expression) | |
| options.CheckInMargin = 5; // 5 min grace period before "missed" | |
| options.MaxRuntime = 30; // alert if running longer than 30 min | |
| options.TimeZone = "America/New_York"; // IANA timezone | |
| options.FailureIssueThreshold = 2; // create issue after 2 consecutive failures | |
| options.RecoveryThreshold = 1; // resolve issue after 1 consecutive success | |
| options.Interval("0 2 * * *"); // 2 AM daily (crontab expression) | |
| options.CheckInMargin = TimeSpan.FromMinutes(5); // 5 min grace period before "missed" | |
| options.MaxRuntime = TimeSpan.FromMinutes(30); // alert if running longer than 30 min | |
| options.TimeZone = "America/New_York"; // IANA timezone | |
| options.FailureIssueThreshold = 2; // create issue after 2 consecutive failures | |
| options.RecoveryThreshold = 1; // resolve issue after 1 consecutive success |
- property
Scheduledoes not exist ... use methodIntervalinstead - property
CheckInMarginis aTimeSpan, not anint - property
MaxRuntimeis aTimeSpan, not anint
| options.Interval(6, SentryMonitorInterval.Hour); // every 6 hours | ||
| options.CheckInMargin = 30; | ||
| options.MaxRuntime = 120; | ||
| options.TimeZone = "UTC"; | ||
| options.FailureIssueThreshold = 1; | ||
| options.RecoveryThreshold = 3; |
There was a problem hiding this comment.
issue: does not compile
| options.Interval(6, SentryMonitorInterval.Hour); // every 6 hours | |
| options.CheckInMargin = 30; | |
| options.MaxRuntime = 120; | |
| options.TimeZone = "UTC"; | |
| options.FailureIssueThreshold = 1; | |
| options.RecoveryThreshold = 3; | |
| options.Interval(6, SentryMonitorInterval.Hour); // every 6 hours | |
| options.CheckInMargin = TimeSpan.FromMinutes(30); | |
| options.MaxRuntime = TimeSpan.FromMinutes(120); | |
| options.TimeZone = "UTC"; | |
| options.FailureIssueThreshold = 1; | |
| options.RecoveryThreshold = 3; |
CheckInMarginandMaxRuntimeare of typeTimeSpan, not of typeint
| | `Schedule` | `string` | Standard crontab expression (e.g., `"*/15 * * * *"`) | | ||
| | `Interval(n, unit)` | method | Interval-based schedule; alternative to `Schedule` | |
There was a problem hiding this comment.
issue: incorrect options
| | `Schedule` | `string` | Standard crontab expression (e.g., `"*/15 * * * *"`) | | |
| | `Interval(n, unit)` | method | Interval-based schedule; alternative to `Schedule` | | |
| | `Interval(crontab)` | method | Standard crontab expression (e.g., `"*/15 * * * *"`) | | |
| | `Interval(interval, unit)` | method | alternative interval-based schedule | |
Scheduledoes not exist- name of first parameter to
Intervalisintervalrather thann
| var ctx = SentrySdk.ContinueTrace(envelope.SentryTrace, envelope.Baggage); | ||
| var transaction = SentrySdk.StartTransaction(ctx, "process-order", "function"); |
There was a problem hiding this comment.
that's right
We do not expose an overload that has three string parameters.
There is an overload, thought, that takes a ITransactionContext and then two string.
| ); | ||
|
|
||
| var app = builder.Build(); | ||
| app.UseSentry(); |
There was a problem hiding this comment.
issue: again, there is no UseSentry extension method receiving an WebApplication
|
|
||
| ```csharp | ||
| // ❌ Loses exception details | ||
| activity.RecordException(ex); |
|
|
||
| ### Option 2: Bridge Pattern | ||
|
|
||
| > **Added in:** `Sentry` ≥6.1.0, `Sentry.OpenTelemetry` ≥6.1.0 |
| ```csharp | ||
| var builder = WebApplication.CreateBuilder(args); | ||
|
|
||
| // Part 1: Configure Sentry with UseOpenTelemetry() | ||
| builder.WebHost.UseSentry(options => | ||
| { | ||
| options.Dsn = "https://...@o0.ingest.sentry.io/..."; | ||
| options.TracesSampleRate = 1.0; | ||
| options.UseOpenTelemetry(); // ← tells Sentry to use OTel for trace context propagation | ||
| // Do NOT also configure Sentry's own DiagnosticSource integration — | ||
| // let OTel instrumentation libraries handle it instead | ||
| }); | ||
|
|
||
| // Part 2: Register OTel TracerProvider with AddSentry() | ||
| builder.Services.AddOpenTelemetry() | ||
| .WithTracing(tracing => tracing | ||
| .AddAspNetCoreInstrumentation() | ||
| .AddHttpClientInstrumentation() | ||
| .AddEntityFrameworkCoreInstrumentation() | ||
| .AddSentry() // ← converts OTel spans to Sentry format | ||
| ); | ||
|
|
||
| var app = builder.Build(); | ||
| app.UseSentry(); | ||
| app.Run(); | ||
| ``` |
There was a problem hiding this comment.
issue: this code sample looks quite wrong @jamescrosswell
Flash0ver
left a comment
There was a problem hiding this comment.
- I haven't checked the Sentry-JS-integration
- I need a bit more time to review Profiling
- I need a bit more time to review Tracing
Direct LLM port of the existing
dotnetSDK skill into the skills-next per-SDK reference layout underskills-next/references/sdks/dotnet/. This content has NOT been reviewed at all — it is a machine-generated port of the existing SDK skill, and every file should be treated as unverified.