Releases: getsentry/sentry-rust
Releases · getsentry/sentry-rust
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
0.43.0
Breaking changes
- ref(tracing): rework tracing to Sentry span name/op conversion (#887) by @lcian
- The
tracingintegration now uses the tracing span name as the Sentry span name by default. - Before this change, the span name would be set based on the
tracingspan target (<module>::<function>when using thetracing::instrumentmacro). - The
tracingintegration now uses<span target>::<span name>as the default Sentry span op (i.e.<module>::<function>when usingtracing::instrument). - Before this change, the span op would be set based on the
tracingspan name. - Read below to learn how to customize the span name and op.
- When upgrading, please ensure to adapt any queries, metrics or dashboards to use the new span names/ops.
- The
- ref(tracing): use standard code attributes (#899) by @lcian
- Logs now carry the attributes
code.module.name,code.file.pathandcode.line.numberstandardized in OTEL to surface the respective information, in contrast with the previously senttracing.module_path,tracing.fileandtracing.line.
- Logs now carry the attributes
- fix(actix): capture only server errors (#877) by @lcian
- The Actix integration now properly honors the
capture_server_errorsoption (enabled by default), capturing errors returned by middleware only if they are server errors (HTTP status code 5xx). - Previously, if a middleware were to process the request after the Sentry middleware and return an error, our middleware would always capture it and send it to Sentry, regardless if it was a client, server or some other kind of error.
- With this change, we capture errors returned by middleware only if those errors can be classified as server errors.
- There is no change in behavior when it comes to errors returned by services, in which case the Sentry middleware only captures server errors exclusively.
- The Actix integration now properly honors the
- fix: send trace origin correctly (#906) by @lcian
TraceContextnow has an additional fieldorigin, used to report which integration created a transaction.
Behavioral changes
- feat(tracing): send both breadcrumbs and logs by default (#878) by @lcian
- If the
logsfeature flag is enabled, andenable_logs: trueis set on your client options, the default Sentrytracinglayer now sends logs for all events at or above INFO.
- If the
Features
-
ref(tracing): rework tracing to Sentry span name/op conversion (#887) by @lcian
- Additional special fields have been added that allow overriding certain data on the Sentry span:
sentry.op: override the Sentry span op.sentry.name: override the Sentry span name.sentry.trace: given a string matching a validsentry-traceheader (sent automatically by client SDKs), continues the distributed trace instead of starting a new one. If the value is not a validsentry-traceheader or a trace is already started, this value is ignored.
sentry.opandsentry.namecan also be applied retroactively by declaring fields with valuetracing::field::Emptyand then recorded usingtracing::Span::record.- Example usage:
#[tracing::instrument(skip_all, fields( sentry.op = "http.server", sentry.name = "GET /payments", sentry.trace = headers.get("sentry-trace").unwrap_or(&"".to_owned()), ))] async fn handle_request(headers: std::collections::HashMap<String, String>) { // ... }
- Additional attributes are sent along with each span by default:
sentry.tracing.target: corresponds to thetracingspan'smetadata.target()code.module.name,code.file.path,code.line.number
- Additional special fields have been added that allow overriding certain data on the Sentry span:
-
feat(core): add Response context (#874) by @lcian
- The
Responsecontext can now be attached to events, to include information about HTTP responses such as headers, cookies and status code. - Example:
let mut event = Event::new(); let response = ResponseContext { cookies: Some(r#""csrftoken": "1234567""#.to_owned()), headers: Some(headers_map), status_code: Some(500), body_size: Some(15), data: Some("Invalid request"), }; event .contexts .insert("response".to_owned(), response.into());
- The
Fixes
- build(panic): Fix build without other dependencies (#883) by @liskin
- The
sentry-paniccrate now builds successfully when used as a standalone dependency.
- The
- fix(transport): add rate limits for logs (#894) by @giortzisg
0.42.0
Features
- feat(log): support kv feature of log (#851) by @lcian
- Attributes added to a
logrecord using thekvfeature are now recorded as attributes on the log sent to Sentry.
- Attributes added to a
- feat(types): add all the missing supported envelope headers (#867) by @lcian
- feat(types): add setters for envelope headers (#868) by @lcian
- It's now possible to set all of the envelope headers supported by the protocol when constructing envelopes.
- feat(core): add some DSC fields to transaction envelope headers (#869) by @lcian
- The SDK now sends additional envelope headers with transactions. This should solve some extrapolation issues for span metrics.
Behavioral changes
- feat: filter username and password in URLs (#864) by @lcian
- Usernames and passwords that could be contained in URLs captured when using the Actix Web or axum integration are now always filtered out.
- If the
Requestis created manually by the user, then these fields are not filtered out. - This information was already filtered by Relay, but should also be filtered by the SDK itself as a first line of defense.
Fixes
- docs: match description of
debugoption with behavior since PR #820 (#860) by @AlexTMjugador
0.41.0
Breaking changes
- feat(tracing): support combined EventFilters and EventMappings (#847) by @lcian
EventFilterhas been changed to abitflagsstruct.- It's now possible to map a
tracingevent to multiple items in Sentry by combining multiple event filters in theevent_filter, e.g.tracing::Level::ERROR => EventFilter::Event | EventFilter::Log. - It's also possible to use
EventMapping::Combinedto map atracingevent to multiple items in Sentry. ctxin the signatures ofevent_from_event,breadcrumb_from_eventandlog_from_eventhas been changed to takeimpl Into<Option<&'context Context<'context, S>>>to avoid cloning theContextwhen mapping to multiple items.
Features
Fixes
Dependencies
- chore(deps): bump
anyhowand disable itsbacktracefeature (#632) by @LunaBorowska
0.40.0
Logs
We've released two new integrations for Sentry structured logs, the tracing and log integration. Read below on how to start sending logs to Sentry.
Breaking changes
- refactor(logs): apply user attributes to log regardless of
send_default_pii(#843) by @lcian- User attributes should be applied to logs regardless of
send_default_pii. Therefore, that parameter was removed fromsentry_core::Scope::apply_to_log.
- User attributes should be applied to logs regardless of
Features
- feat(tracing): add support for logs (#840) by @lcian
- To capture
tracingevents as Sentry structured logs, enable thelogsfeature of thesentrycrate. - Then, initialize the SDK with
enable_logs: truein your client options. - Finally, set up a custom event filter to map events to logs based on criteria such as severity. For example:
let sentry_layer = sentry_tracing::layer().event_filter(|md| match *md.level() { tracing::Level::ERROR => EventFilter::Event, tracing::Level::TRACE => EventFilter::Ignore, _ => EventFilter::Log, });
- To capture
- feat(log): add support for logs (#841) by @lcian
- To capture
logrecords as Sentry structured logs, enable thelogsfeature of thesentrycrate. - Then, initialize the SDK with
enable_logs: truein your client options. - Finally, set up a custom event filter to map records to Sentry logs based on criteria such as severity. For example:
let logger = sentry::integrations::log::SentryLogger::new().filter(|md| match md.level() { log::Level::Error => LogFilter::Event, log::Level::Trace => LogFilter::Ignore, _ => LogFilter::Log, });
- To capture
- refactor(logs): cache default attributes and add OS attributes (#842) by @lcian
os.nameandos.versionare now being attached to logs as default attributes.
Fixes
Behavioral changes
- refactor(tracing): refactor internal code and improve docs (#839) by @lcian
- Errors carried by breadcrumbs will now be stored in the breadcrumb
dataunder their original field name. - Before, they were all stored under a single key called
errors.
- Errors carried by breadcrumbs will now be stored in the breadcrumb
Dependencies
0.39.0
Logs
Support for Sentry structured logs has been added to the SDK.
- To set up logs, enable the
logsfeature of thesentrycrate and setenable_logstotruein your client options. - Then, use the
logger_trace!,logger_debug!,logger_info!,logger_warn!,logger_error!andlogger_fatal!macros to capture logs. - To filter or update logs before they are sent, you can use the
before_send_logclient option. - Please note that breaking changes could occur until the API is finalized.
Features
- feat(logs): add log protocol types (#821) by @lcian
- feat(logs): add ability to capture and send logs (#823) by @lcian & @Swatinem
- feat(logs): add macro-based API (#827) by @lcian & @szokeasaurusrex
- feat(logs): send logs in batches (#831) by @lcian
Behavioral changes
- refactor(core): remove support for traceparent (#807) by @lcian
- The SDK doesn't support parsing the
traceparentdistributed tracing header anymore. This means thatcontinue_from_headers(and, as a consequence,parse_headers) will only take into account thesentry-traceheader from now on. - If you need to continue traces based on the information in the
traceparentheader, please parse the information from it and then use the API to manually create the desired transaction.
- The SDK doesn't support parsing the
- feat(core): implement Tracing without Performance (#811) by @lcian
- The SDK now implements Tracing without Performance, which makes it so that each
Scopeis associated with an object holding some tracing information. - This information is used as a fallback when capturing an event with tracing disabled or otherwise no ongoing span, to still allow related events to be linked by a trace.
- A new API
Scope::iter_trace_propagation_headershas been provided that will use the fallback tracing information if there is no currentSpanon theScope.
- The SDK now implements Tracing without Performance, which makes it so that each
Breaking changes
0.38.1
Fixes
- build: include
sentry-actixoptionally whenrelease-healthis enabled (#806) by @lciansentry-actixis now being included as a dependency only when explicitly added, either as a direct dependency or through theactixfeature flag of thesentrycrate.- Due to a mistake in the
Cargo.toml, it was previously being included as a dependency by default when using just thesentrycrate with default features.