Releases: getsentry/sentry-rust
Releases · getsentry/sentry-rust
0.48.3
The Sentry Rust SDK now reports data discarded by the SDK to Sentry’s Stats page. The SDK reports approximate counts for drops from transports, queues, rate-limit backoff, sampling, event processors, and before_send* callbacks, including span counts for dropped transactions and byte counts for dropped logs and metrics.
New Features
- Added
EnvelopeFilterandEnvelopeFilterCallbacks, which let callers observe envelope items removed byEnvelope::filter, including attachments removed after their event or transaction is filtered out. ExistingEnvelope::filterclosure callers continue to work, although some closures may require an explicit item type annotation (#1182). - Added the
LossSourcetrait, which provides the client report data categories and quantities to report when supported Sentry data is dropped (#1170). - Added
TransportFactory::create_transport_with_options, which constructs transports fromTransportOptionsinstead of fullClientOptions(#1142). - Added transport-specific options types and
with_optionsconstructors for built-in HTTP transports, includingReqwestHttpTransportOptions,CurlHttpTransportOptions,UreqHttpTransportOptions, andEmbeddedSVCHttpTransportOptions(#1142). - Added transport worker options types and deprecated the legacy constructors for built-in background transport workers, including
StdTransportThreadOptionsandTokioTransportThreadOptions(#1142). - Added client report protocol types in
sentry-types, includingClientReport,client_report::Item,client_report::Category, andclient_report::Reason, plus support for serializingclient_reportenvelope items (#1144). - Added a client report
Recordertype, which modernTransportFactoryimplementations receive viaTransportOptions. Transports can use this recorder to record discarded Sentry data; the SDK aggregates these reported losses and automatically sends them in a future envelope (#1158).
Deprecations
- Deprecated
Hub::with. UseHub::currentinstead (#1126).
Fixes
- Fixed
ureqtransport handling for HTTP error statuses so429rate limits and413payload-too-large responses are processed correctly (#1177).
Behavior Changes
- Custom transport factories that implement
TransportFactory::create_transportnow receiveClientOptionsreconstructed fromTransportOptions. The reconstructed options include only transport-relevant fields, such as DSN, user agent, proxy settings, and TLS certificate validation settings. This may affect code that reads non-transport fields increate_transport, but the API remains source-compatible and this change is included in a minor/patch release (#1142).
0.48.2
New Features
- Added
rustls-no-providerfeature flag in thesentrycrate to allow using therustlstransport with a different crypto provider (#1103).
Fixes
0.48.1
Fixes
- Changed
ClientOptions::enable_metricsto default totrue, aligning metrics behavior with other Sentry SDKs (#1106). Metric capture APIs still require themetricsfeature flag at compile time.
0.48.0
Breaking Changes
- Added the following metrics-related fields to the
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).
- There are several breakages related to the SemVer feature additivity bug fixes:
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 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.
0.47.0
Breaking Changes
- Update reqwest from 0.12.25 to 0.13.1 (#998). This change is breaking for users who use the
RequestHttpTransport::with_clientmethod. sentry_core::HubSwitchGuardis now!Send, preventing it from being moved across threads (#957).
New Features
- Added a
Envelope::into_itemsmethod, which returns an iterator over ownedEnvelopeItems in theEnvelope(#983). - Expose transport utilities (#949)
Fixes
0.46.2
0.46.1
0.46.0
Breaking changes
- Removed the
ClientOptionsstruct'strim_backtracesandextra_border_framesfields (#925).- These fields configured backtrace trimming, which is being removed in this release.
Improvements
- Removed backtrace trimming to align the Rust SDK with the general principle that Sentry SDKs should only truncate telemetry data when needed to comply with documented size limits (#925). This change ensures that as much data as possible remains available for debugging.
- If you notice any new issues being created for existing errors after this change, please open an issue on GitHub.
Fixes
0.45.0
0.44.0
Breaking changes
- feat(log): support combined LogFilters and RecordMappings (#914) by @lcian
- Breaking change:
sentry::integrations::log::LogFilterhas been changed to abitflagsstruct. - It's now possible to map a
logrecord to multiple items in Sentry by combining multiple log filters in the filter, e.g.log::Level::ERROR => LogFilter::Event | LogFilter::Log. - If using a custom
mapperinstead, it's possible to return aVec<sentry::integrations::log::RecordMapping>to map alogrecord to multiple items in Sentry.
- Breaking change:
Behavioral changes
- ref(log): send logs by default when logs feature flag is enabled (#915) by @lcian
- If the
logsfeature flag is enabled, the default Sentryloglogger now sends logs for all events at or above INFO.
- If the
- ref(logs): enable logs by default if logs feature flag is used (#910) by @lcian
- This changes the default value of
sentry::ClientOptions::enable_logstotrue. - This simplifies the setup of Sentry structured logs by requiring users to just add the
logfeature flag to thesentrydependency to opt-in to sending logs. - When the
logfeature flag is enabled, thetracingandlogintegrations will send structured logs to Sentry for all logs/events at or above INFO level by default.
- This changes the default value of