Requested by: @szokeasaurusrex
Merge target: (default)
Quick links:
Assign the accepted label to this issue to approve the release.
Targets
Checked targets will be skipped (either already published or user-requested skip). Uncheck to retry a target.
📋 Changelog
Breaking Changes
New Features
📊📈💯 The Sentry-Rust SDK now supports emitting Sentry Metrics (#1073)!
To get started, you will need to add the metrics feature flag when compiling the sentry crate. You will also need to enable metrics when initializing the SDK, like so:
use sentry::ClientOptions;
let _guard = sentry::init((
"(your DSN here)",
ClientOptions {
enable_metrics: true,
// ... other options ...
..Default::default()
},
));
You can then capture metrics as follows:
use sentry::metrics;
use sentry::types::protocol::latest::Unit;
// We support counter, gauge, and distribution metrics.
metrics::counter("example.counter", 1).capture();
metrics::gauge("connections", 20).capture();
metrics::distribution("response.time", 123.4)
.unit(Unit::Millisecond) // units can also be set on gauges
.attribute("http.status", 200) // attributes can be set on all metric types
.capture();
Fixes
- Fixed several feature additivity SemVer violations, where enabling a feature flag could have introduced breaking changes. All known violations are fixed now, so simply enabling an additional feature flag in any Sentry SDK crate should no longer cause any public API breakages. Fixing these issues required us to break the public API in some places; those breakages are detailed above.
Requested by: @szokeasaurusrex
Merge target: (default)
Quick links:
Assign the accepted label to this issue to approve the release.
Targets
Checked targets will be skipped (either already published or user-requested skip). Uncheck to retry a target.
📋 Changelog
Breaking Changes
ClientOptionsstruct insentry-core. Both fields are no-ops, unless themetricsfeature flag is enabled:enable_metrics, used to enable sending metrics to Sentry (#1073).before_send_metric, used to define a callback for filtering/pre-processing metrics before sending to Sentry (#1064).sentry_core::ClientOptionsfieldsbefore_send_log,enable_logs,auto_session_tracking, andsession_modeare no longer gated behind thelogsandrelease-healthfeature flags (#1091). Code that constructsClientOptionswith a full struct literal (without..Default::default()), or which exhaustively matches against it, must now include all four fields regardless of enabled features.sentry_core::Scopecan no longer be publicly constructed or exhaustively matched against, even when theclientfeature is disabled (#1094). Previously, both of these were possible whenclientwas disabled.sentry_core::Scope::add_event_processornow requires passed closures to beRefUnwindSafe(#1093). Thanks to this change,sentry_core::Scopeis nowUnwindSaferegardless of feature flag configuration; previously,Scopewas onlyUnwindSafewhen theclientfeature was disabled.sentry_tracing::EventMappingis now#[non_exhaustive](#1097).sentry_log::RecordMappingis now#[non_exhaustive](#1098).New Features
📊📈💯 The Sentry-Rust SDK now supports emitting Sentry Metrics (#1073)!
To get started, you will need to add the
metricsfeature flag when compiling thesentrycrate. You will also need to enable metrics when initializing the SDK, like so:You can then capture metrics as follows:
Fixes