Benchmark for #957#1006
Draft
szokeasaurusrex wants to merge 25 commits intoszokeasaurusrex/hubswitchguardfrom
Draft
Benchmark for #957#1006szokeasaurusrex wants to merge 25 commits intoszokeasaurusrex/hubswitchguardfrom
szokeasaurusrex wants to merge 25 commits intoszokeasaurusrex/hubswitchguardfrom
Conversation
Add a new method called `into_items` to the `Envelope` type. This method is similar to the existing `items` method, except that it yields owned `EnvelopeItem`s rather than references. Also, refactor a test where we can use this new method to avoid a clone. I intend to use this method elsewhere in the future, that is why I am adding it.
HubSwitchGuard manages thread-local hub state but was Send, allowing it to be moved to another thread. When dropped on the wrong thread, it would corrupt that thread's hub state instead of restoring the original thread. To fix this, add PhantomData<MutexGuard<'static, ()>> to make the guard !Send while keeping it Sync. This prevents the guard from being moved across threads at compile time. Additionally, refactor sentry-tracing to store guards in thread-local storage keyed by span ID instead of in span extensions. This fixes a related bug where multiple threads entering the same span would clobber each other's guards. Fixes #943 Refs RUST-130 Co-Authored-By: Claude <noreply@anthropic.com>
Bump the MSRV to 1.88 to allow dependency updates (see #968). I do not think this change requires a major version bump, as our [MSRV policy](https://github.com/getsentry/sentry-rust?tab=readme-ov-file#requirements) states we try to support the last six months of Rust versions, and 1.88 is more than six months old. Stacked on #969.
Bumps [time](https://github.com/time-rs/time) from 0.3.41 to 0.3.47. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/time-rs/time/releases">time's releases</a>.</em></p> <blockquote> <h2>v0.3.47</h2> <p>See the <a href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">changelog</a> for details.</p> <h2>v0.3.46</h2> <p>See the <a href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">changelog</a> for details.</p> <h2>v0.3.45</h2> <p>See the <a href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">changelog</a> for details.</p> <h2>v0.3.44</h2> <p>See the <a href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">changelog</a> for details.</p> <h2>v0.3.43</h2> <p>See the <a href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">changelog</a> for details.</p> <h2>v0.3.42</h2> <p>See the <a href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">changelog</a> for details.</p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">time's changelog</a>.</em></p> <blockquote> <h2>0.3.47 [2026-02-05]</h2> <h3>Security</h3> <ul> <li> <p>The possibility of a stack exhaustion denial of service attack when parsing RFC 2822 has been eliminated. Previously, it was possible to craft input that would cause unbounded recursion. Now, the depth of the recursion is tracked, causing an error to be returned if it exceeds a reasonable limit.</p> <p>This attack vector requires parsing user-provided input, with any type, using the RFC 2822 format.</p> </li> </ul> <h3>Compatibility</h3> <ul> <li>Attempting to format a value with a well-known format (i.e. RFC 3339, RFC 2822, or ISO 8601) will error at compile time if the type being formatted does not provide sufficient information. This would previously fail at runtime. Similarly, attempting to format a value with ISO 8601 that is only configured for parsing (i.e. <code>Iso8601::PARSING</code>) will error at compile time.</li> </ul> <h3>Added</h3> <ul> <li>Builder methods for format description modifiers, eliminating the need for verbose initialization when done manually.</li> <li><code>date!(2026-W01-2)</code> is now supported. Previously, a space was required between <code>W</code> and <code>01</code>.</li> <li><code>[end]</code> now has a <code>trailing_input</code> modifier which can either be <code>prohibit</code> (the default) or <code>discard</code>. When it is <code>discard</code>, all remaining input is ignored. Note that if there are components after <code>[end]</code>, they will still attempt to be parsed, likely resulting in an error.</li> </ul> <h3>Changed</h3> <ul> <li>More performance gains when parsing.</li> </ul> <h3>Fixed</h3> <ul> <li>If manually formatting a value, the number of bytes written was one short for some components. This has been fixed such that the number of bytes written is always correct.</li> <li>The possibility of integer overflow when parsing an owned format description has been effectively eliminated. This would previously wrap when overflow checks were disabled. Instead of storing the depth as <code>u8</code>, it is stored as <code>u32</code>. This would require multiple gigabytes of nested input to overflow, at which point we've got other problems and trivial mitigations are available by downstream users.</li> </ul> <h2>0.3.46 [2026-01-23]</h2> <h3>Added</h3> <ul> <li>All possible panics are now documented for the relevant methods.</li> <li>The need to use <code>#[serde(default)]</code> when using custom <code>serde</code> formats is documented. This applies only when deserializing an <code>Option<T></code>.</li> <li><code>Duration::nanoseconds_i128</code> has been made public, mirroring <code>std::time::Duration::from_nanos_u128</code>.</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/time-rs/time/commit/d5144cd2874862d46466c900910cd8577d066019"><code>d5144cd</code></a> v0.3.47 release</li> <li><a href="https://github.com/time-rs/time/commit/f6206b050fd54817d8872834b4d61f605570e89b"><code>f6206b0</code></a> Guard against integer overflow in release mode</li> <li><a href="https://github.com/time-rs/time/commit/1c63dc7985b8fa26bd8c689423cc56b7a03841ee"><code>1c63dc7</code></a> Avoid denial of service when parsing Rfc2822</li> <li><a href="https://github.com/time-rs/time/commit/5940df6e72efb63d246ca1ca59a0f836ad32ad8a"><code>5940df6</code></a> Add builder methods to avoid verbose construction</li> <li><a href="https://github.com/time-rs/time/commit/00881a4da1bc5a6cb6313052e5017dbd7daa40f0"><code>00881a4</code></a> Manually format macros everywhere</li> <li><a href="https://github.com/time-rs/time/commit/bb723b6d826e46c174d75cd08987061984b0ceb7"><code>bb723b6</code></a> Add <code>trailing_input</code> modifier to <code>end</code></li> <li><a href="https://github.com/time-rs/time/commit/31c4f8e0b56e6ae24fe0d6ef0e492b6741dda783"><code>31c4f8e</code></a> Permit <code>W12</code> in <code>date!</code> macro</li> <li><a href="https://github.com/time-rs/time/commit/490a17bf306576850f33a86d3ca95d96db7b1dcd"><code>490a17b</code></a> Mark error paths in well-known formats as cold</li> <li><a href="https://github.com/time-rs/time/commit/6cb1896a600be1538ecfab8f233fe9cfe9fa8951"><code>6cb1896</code></a> Optimize <code>Rfc2822</code> parsing</li> <li><a href="https://github.com/time-rs/time/commit/6d264d59c25e3da0453c3defebf4640b0086a006"><code>6d264d5</code></a> Remove erroneous <code>#[inline(never)]</code> attributes</li> <li>Additional commits viewable in <a href="https://github.com/time-rs/time/compare/v0.3.41...v0.3.47">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) Fixes #985 Fixes [RUST-148](https://linear.app/getsentry/issue/RUST-148/rustsec-2026-0009-denial-of-service-via-stack-exhaustion) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/getsentry/sentry-rust/network/alerts). </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This reverts commit 750dec0, which introduced `cargo nextest` for the Rust stable tests, only (MSRV tests have consistently used `cargo test`). With this change, we also revert the Sentry Prevent upload. Resolves #972 Resolves [RUST-138](https://linear.app/getsentry/issue/RUST-138/replace-nextest-and-sentry-prevent-with-cargo-test)
Replace CI make invocations with explicit cargo commands to make workflow behavior easier to read directly in the CI config. Remove the root Makefile to avoid maintaining a separate command layer in addition to the workflow definitions. Closes GH-973 Closes [RUST-139](https://linear.app/getsentry/issue/RUST-139/delete-the-makefile-and-remove-references)
### Description Move RUSTFLAGS=-Dwarnings to workflow-level env in ci.yml and remove duplicated step-level env blocks from check and MSRV jobs. #### Issues Closes #976 Closes [RUST-142](https://linear.app/getsentry/issue/RUST-142/enforce-rustflags=-dwarnings-across-all-ci-jobs)
Add a single required-check aggregator job to CI. This makes branch protection easier to manage while still enforcing the full required CI set, and keeps `codecov` intentionally out of the gate. Closes #977 Closes [RUST-143](https://linear.app/getsentry/issue/RUST-143/add-aggregator-required-ci-job)
Run both check and test over a shared os×rust matrix for stable and 1.88.0, and remove the standalone MSRV job to reduce drift. Keep check permutations identical across toolchains, add explicit workspace doc-test runs in test, and retain an explicit sentry default+test feature assertion with an inline rationale comment. Closes #974 Closes [RUST-140](https://linear.app/getsentry/issue/RUST-140/align-msrv-and-stable-ci-coverage-including-doc-tests)
Add --locked to cargo invocations in CI and weekly workflows so checks fail if Cargo.lock is out of sync. This keeps automation aligned with reproducible dependency resolution and prevents CI from silently updating lockfile state. Closes #982 Closes [RUST-147](https://linear.app/getsentry/issue/RUST-147/ensure-all-jobs-run-with-locked)
Configure workflow-level concurrency in ci.yml so newer runs for the same workflow+ref cancel older in-progress runs. Use github.head_ref || github.ref to keep PR and branch pushes grouped correctly without changing any job logic. Closes #979 Closes [RUST-145](https://linear.app/getsentry/issue/RUST-145/add-ci-concurrency-with-cancel-in-progress)
Refactor the top-level CI workflow into a thin orchestrator that calls reusable workflows for lint, check, test, and doc lanes via job-level uses. Keep lane behavior unchanged by moving the existing matrices, commands, flags, and environment settings into the called workflows. Keep codecov inline in ci.yml and preserve the required aggregator job identity and gating behavior so required checks remain stable during the refactor. Closes #980 Closes [RUST-146](https://linear.app/getsentry/issue/RUST-146/split-ci-into-reusable-workflows)
## Summary This PR migrates from the deprecated `action-prepare-release` to the new Craft GitHub Actions. ## Changes - Migrated `.github/workflows/release.yml` to Craft reusable workflow ## Documentation See https://getsentry.github.io/craft/github-actions/ for more information. --------- Co-authored-by: Daniel Szoke <daniel.szoke@sentry.io>
### Description Exposes `RateLimiter`, `RateLimiterCategory`, `StdTransportThread` and `TokioTransportThread` from the `transports` module. #### Issues Resolves: #941 #### Reminders - Add GH Issue ID _&_ Linear ID (if applicable) - Add an entry to CHANGELOG.md, following the format of existing entries - The PR title should use [Conventional Commits](https://develop.sentry.dev/engineering-practices/commit-messages/#type) style (`feat:`, `fix:`, `ref:`, `meta:`, etc.) - Useful links for external contributors: [Sentry SDK development docs](https://develop.sentry.dev/sdk/), [Discord community](https://discord.gg/sentry) --------- Co-authored-by: Daniel Szoke <daniel.szoke@sentry.io>
Adds `.claude/settings.json` to enable Claude Code with: - Basic bash commands (find, ls, git, grep, mv) - WebFetch access to GitHub and Sentry documentation sites This follows the same pattern used in other Sentry SDK repositories like sentry-javascript, sentry-dart, and sentry-react-native. Note: This adds .claude/settings.json with -f flag since .claude is in .gitignore for local settings. --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: Daniel Szoke <daniel.szoke@sentry.io> Co-authored-by: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com>
# Conflicts: # CHANGELOG.md
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
### Features
- Benchmark for #957 ([#1006](https://github.com/getsentry/sentry-rust/pull/1006))If none of the above apply, you can opt out of this check by adding |
3da679d to
d0f44d8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a benchmark for #957
Results from my local run
fullorigin/masterszokeasaurusrex/hubswitchguard (c73d834fcde0dffc6921f1585d0d7fe83b01ff29)origin/mastermean (ns)