feat: upgrade Sentry SDK to 6.1.0-alpha.1 and add trace-connected met…#252
feat: upgrade Sentry SDK to 6.1.0-alpha.1 and add trace-connected met…#252bruno-garcia merged 4 commits intomainfrom
Conversation
bf37ff6 to
6170166
Compare
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Build / dependencies / internal 🔧
🤖 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 <noreply@anthropic.com>
6170166 to
3452a2a
Compare
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 <noreply@anthropic.com>
- SentryClientMetrics now accepts IHub in constructor (defaults to HubAdapter.Instance) - Tests use isolated SDK instances with recording transport - Each test initializes/disposes its own SDK for proper isolation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Not sure if the Tests add some "real" value, as they essentially confirm that each overridden method of the derived SentryClientMetrics is indeed calling into the SentrySDK-Metrics-APIs ... but they are technically valid and are a foundation we can increment on later with following updates.
Other than that: ✅ ... we should see some Metrics!
|
the tests verified the metrics class did result in Sentry's SDK capturing the metrics. So a mix of testing that the SentryClientMetrics added metrics and with what key, as well as the SDK got them into the transport. That said I was trying to verify the DI container registrations but didn't get that far. I deleted the test file |
…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:
The new metrics API provides:
Metrics are automatically correlated with the active trace/span.
🤖 Generated with Claude Code