Skip to content

Conversation

@bruno-garcia
Copy link
Member

…rics

Upgrades Sentry .NET SDK from 6.0.0 to 6.1.0-alpha.1 to test the new experimental trace-connected metrics API from PR getsentry/sentry-dotnet#4834.

Changes:

  • Upgrade Sentry SDK to 6.1.0-alpha.1
  • Add SentryClientMetrics decorator that emits metrics to Sentry
  • Enable experimental metrics in all apps (Server, Console, Android)
  • Use SentryClientMetrics in DI registrations

The new metrics API provides:

  • AddCounter: for counting events (files, uploads, errors)
  • RecordDistribution: for value distributions (uploaded bytes)
  • RecordGauge: for point-in-time values (jobs in flight)

Metrics are automatically correlated with the active trace/span.

🤖 Generated with Claude Code

{
o.CaptureFailedRequests = true;
o.EnableLogs = true;
o.Experimental.EnableMetrics = true;

This comment was marked as outdated.

@bruno-garcia bruno-garcia force-pushed the feat/sentry-trace-metrics branch from bf37ff6 to 6170166 Compare January 11, 2026 11:09
@github-actions
Copy link

github-actions bot commented Jan 11, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • Upgrade Sentry SDK to 6.1.0-alpha.1 and add trace-connected met… by bruno-garcia in #252

Build / dependencies / internal 🔧

  • (release) Switch from action-prepare-release to Craft by BYK in #251

🤖 This preview updates automatically when you update the PR.

…rics

Upgrades Sentry .NET SDK from 6.0.0 to 6.1.0-alpha.1 to test the new
experimental trace-connected metrics API from PR getsentry/sentry-dotnet#4834.

Changes:
- Upgrade Sentry SDK to 6.1.0-alpha.1
- Add SentryClientMetrics decorator that emits metrics to Sentry
- Make ClientMetrics methods virtual for proper polymorphism
- Enable experimental metrics in all apps (Server, Console, Android)
- Use SentryClientMetrics in DI registrations (Core, Server, Console)
- Fix duplicate ClientMetrics registration in Core/Startup.cs

The new metrics API provides:
- AddCounter: for counting events (files, uploads, errors)
- RecordDistribution: for value distributions (uploaded bytes)
- RecordGauge: for point-in-time values (jobs in flight)

Metrics are automatically correlated with the active trace/span.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@bruno-garcia bruno-garcia force-pushed the feat/sentry-trace-metrics branch from 6170166 to 3452a2a Compare January 11, 2026 11:12
@bruno-garcia bruno-garcia marked this pull request as draft January 11, 2026 11:13
Adds tests to verify that:
- SentryClientMetrics emits trace_metric items to Sentry
- All metric types (Counter, Distribution, Gauge) are emitted
- Base class counters are also incremented (dual emission)
- Polymorphism works correctly (override vs new)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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.

2 participants