fix(dotnet-sdk): add metrics reference documenting SENTRY1001 analyzer#80
Draft
fix(dotnet-sdk): add metrics reference documenting SENTRY1001 analyzer#80
Conversation
Add references/metrics.md documenting: - EmitCounter, EmitGauge, EmitDistribution API - Supported numeric types (byte, short, int, long, float, double) - SENTRY1001 Roslyn diagnostic analyzer - SetBeforeSendMetric callback - SentryMetric.TryGetValue<T> - EnableMetrics config option Update SKILL.md to include Metrics in feature recommendations and reference file table. Addresses getsentry/sentry-dotnet#4840 Co-Authored-By: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: HazAT <363802+HazAT@users.noreply.github.com> Agent-Logs-Url: https://github.com/getsentry/sentry-for-ai/sessions/a7f23faf-52d2-4883-89e9-a8846d16dd40
Copilot
AI
changed the title
[WIP] Update sentry-dotnet-sdk for new Roslyn analyzer
fix(dotnet-sdk): add metrics reference documenting SENTRY1001 analyzer
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SDK drift from getsentry/sentry-dotnet#4840 — the .NET SDK now ships a Roslyn analyzer (
SENTRY1001) that warns at compile time when metrics APIs are called with unsupported numeric types.New:
references/metrics.mdEmitCounter,EmitGauge,EmitDistributionwith usage examplesbyte,short,int,long,float,double; unsupported types (decimal,ulong,uint,Int128) are no-ops at runtimeSENTRY1001diagnostic — trigger conditions, severity, message format, suppression guidanceSetBeforeSendMetriccallback for filtering/modifying metrics before sendSentryMetric.TryGetValue<T>— type-safe value extraction (same type rules apply)EnableMetrics) and 5 troubleshooting entriesUpdated:
SKILL.mdAdded Metrics to the feature recommendation list and reference file routing table.
All API names verified against
getsentry/sentry-dotnetsource.build-skill-tree.sh --checkpasses.Original prompt
⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.