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).