From 8787ee4d0e1250c3ff1f85aca215c0151873c089 Mon Sep 17 00:00:00 2001 From: Tony Xiao Date: Wed, 20 Aug 2025 00:53:14 -0400 Subject: [PATCH 1/8] fix(tracing): Do not attach stacktrace to transaction (#4713) The `attach_stacktrace` option was attaching stack traces to transactions. This is an expensive operation but the results aren't used anywhere. --- sentry_sdk/client.py | 6 ++++-- tests/test_client.py | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/sentry_sdk/client.py b/sentry_sdk/client.py index 5d584a5537..c45d5e2f4f 100644 --- a/sentry_sdk/client.py +++ b/sentry_sdk/client.py @@ -516,8 +516,9 @@ def _prepare_event( if event.get("timestamp") is None: event["timestamp"] = datetime.now(timezone.utc) + is_transaction = event.get("type") == "transaction" + if scope is not None: - is_transaction = event.get("type") == "transaction" spans_before = len(cast(List[Dict[str, object]], event.get("spans", []))) event_ = scope.apply_to_event(event, hint, self.options) @@ -560,7 +561,8 @@ def _prepare_event( ) if ( - self.options["attach_stacktrace"] + not is_transaction + and self.options["attach_stacktrace"] and "exception" not in event and "stacktrace" not in event and "threads" not in event diff --git a/tests/test_client.py b/tests/test_client.py index 0468fcbb7b..a02ea6e56a 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -21,6 +21,7 @@ capture_exception, capture_event, set_tag, + start_transaction, ) from sentry_sdk.spotlight import DEFAULT_SPOTLIGHT_URL from sentry_sdk.utils import capture_internal_exception @@ -562,6 +563,15 @@ def test_attach_stacktrace_disabled(sentry_init, capture_events): assert "threads" not in event +def test_attach_stacktrace_transaction(sentry_init, capture_events): + sentry_init(traces_sample_rate=1.0, attach_stacktrace=True) + events = capture_events() + with start_transaction(name="transaction"): + pass + (event,) = events + assert "threads" not in event + + def test_capture_event_works(sentry_init): sentry_init(transport=_TestTransport()) pytest.raises(EnvelopeCapturedError, lambda: capture_event({})) From 9e154f7c15934fc14c091d5abc4e729dcaa374a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Aug 2025 12:39:59 +0200 Subject: [PATCH 2/8] build(deps): bump actions/create-github-app-token from 2.1.0 to 2.1.1 (#4710) Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 2.1.0 to 2.1.1.
Release notes

Sourced from actions/create-github-app-token's releases.

v2.1.1

2.1.1 (2025-08-11)

Bug Fixes

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/create-github-app-token&package-manager=github_actions&previous-version=2.1.0&new-version=2.1.1)](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) ---
Dependabot commands and options
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 merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show 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)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6197f9023d..066c58595d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Get auth token id: token - uses: actions/create-github-app-token@0f859bf9e69e887678d5bbfbee594437cb440ffe # v2.1.0 + uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1 with: app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} From b8248a39a27374179c7b7f03c0aca1678dead01c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Aug 2025 10:42:55 +0000 Subject: [PATCH 3/8] build(deps): bump codecov/codecov-action from 5.4.3 to 5.5.0 (#4717) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.4.3 to 5.5.0.
Release notes

Sourced from codecov/codecov-action's releases.

v5.5.0

What's Changed

New Contributors

Full Changelog: https://github.com/codecov/codecov-action/compare/v5.4.3...v5.5.0

Changelog

Sourced from codecov/codecov-action's changelog.

v5.5.0

What's Changed

Full Changelog: https://github.com/codecov/codecov-action/compare/v5.4.3..v5.5.0

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=codecov/codecov-action&package-manager=github_actions&previous-version=5.4.3&new-version=5.5.0)](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) ---
Dependabot commands and options
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 merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show 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)
--------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ivana Kellyer --- .github/workflows/test-integrations-ai.yml | 4 ++-- .github/workflows/test-integrations-cloud.yml | 4 ++-- .github/workflows/test-integrations-common.yml | 2 +- .github/workflows/test-integrations-dbs.yml | 4 ++-- .github/workflows/test-integrations-flags.yml | 2 +- .github/workflows/test-integrations-gevent.yml | 2 +- .github/workflows/test-integrations-graphql.yml | 2 +- .github/workflows/test-integrations-misc.yml | 2 +- .github/workflows/test-integrations-network.yml | 4 ++-- .github/workflows/test-integrations-tasks.yml | 4 ++-- .github/workflows/test-integrations-web-1.yml | 2 +- .github/workflows/test-integrations-web-2.yml | 4 ++-- scripts/split_tox_gh_actions/templates/test_group.jinja | 2 +- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test-integrations-ai.yml b/.github/workflows/test-integrations-ai.yml index dd57f5909b..702496acd9 100644 --- a/.github/workflows/test-integrations-ai.yml +++ b/.github/workflows/test-integrations-ai.yml @@ -87,7 +87,7 @@ jobs: coverage xml - name: Upload coverage to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@v5.4.3 + uses: codecov/codecov-action@v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml @@ -166,7 +166,7 @@ jobs: coverage xml - name: Upload coverage to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@v5.4.3 + uses: codecov/codecov-action@v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml diff --git a/.github/workflows/test-integrations-cloud.yml b/.github/workflows/test-integrations-cloud.yml index e79c9513ef..c64c955855 100644 --- a/.github/workflows/test-integrations-cloud.yml +++ b/.github/workflows/test-integrations-cloud.yml @@ -87,7 +87,7 @@ jobs: coverage xml - name: Upload coverage to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@v5.4.3 + uses: codecov/codecov-action@v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml @@ -166,7 +166,7 @@ jobs: coverage xml - name: Upload coverage to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@v5.4.3 + uses: codecov/codecov-action@v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml diff --git a/.github/workflows/test-integrations-common.yml b/.github/workflows/test-integrations-common.yml index c7e356420c..dc46d8d475 100644 --- a/.github/workflows/test-integrations-common.yml +++ b/.github/workflows/test-integrations-common.yml @@ -67,7 +67,7 @@ jobs: coverage xml - name: Upload coverage to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@v5.4.3 + uses: codecov/codecov-action@v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml diff --git a/.github/workflows/test-integrations-dbs.yml b/.github/workflows/test-integrations-dbs.yml index 6c203379fe..aa938a3ccb 100644 --- a/.github/workflows/test-integrations-dbs.yml +++ b/.github/workflows/test-integrations-dbs.yml @@ -107,7 +107,7 @@ jobs: coverage xml - name: Upload coverage to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@v5.4.3 + uses: codecov/codecov-action@v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml @@ -206,7 +206,7 @@ jobs: coverage xml - name: Upload coverage to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@v5.4.3 + uses: codecov/codecov-action@v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml diff --git a/.github/workflows/test-integrations-flags.yml b/.github/workflows/test-integrations-flags.yml index 926465990d..64529064e9 100644 --- a/.github/workflows/test-integrations-flags.yml +++ b/.github/workflows/test-integrations-flags.yml @@ -79,7 +79,7 @@ jobs: coverage xml - name: Upload coverage to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@v5.4.3 + uses: codecov/codecov-action@v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml diff --git a/.github/workflows/test-integrations-gevent.yml b/.github/workflows/test-integrations-gevent.yml index a08e91c909..f8babbecee 100644 --- a/.github/workflows/test-integrations-gevent.yml +++ b/.github/workflows/test-integrations-gevent.yml @@ -67,7 +67,7 @@ jobs: coverage xml - name: Upload coverage to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@v5.4.3 + uses: codecov/codecov-action@v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml diff --git a/.github/workflows/test-integrations-graphql.yml b/.github/workflows/test-integrations-graphql.yml index 9bbeee6c6a..454bc1d5ea 100644 --- a/.github/workflows/test-integrations-graphql.yml +++ b/.github/workflows/test-integrations-graphql.yml @@ -79,7 +79,7 @@ jobs: coverage xml - name: Upload coverage to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@v5.4.3 + uses: codecov/codecov-action@v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml diff --git a/.github/workflows/test-integrations-misc.yml b/.github/workflows/test-integrations-misc.yml index 3595640ce1..b049ad5642 100644 --- a/.github/workflows/test-integrations-misc.yml +++ b/.github/workflows/test-integrations-misc.yml @@ -87,7 +87,7 @@ jobs: coverage xml - name: Upload coverage to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@v5.4.3 + uses: codecov/codecov-action@v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml diff --git a/.github/workflows/test-integrations-network.yml b/.github/workflows/test-integrations-network.yml index 3ac5508dab..a79dc0dd2b 100644 --- a/.github/workflows/test-integrations-network.yml +++ b/.github/workflows/test-integrations-network.yml @@ -75,7 +75,7 @@ jobs: coverage xml - name: Upload coverage to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@v5.4.3 + uses: codecov/codecov-action@v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml @@ -142,7 +142,7 @@ jobs: coverage xml - name: Upload coverage to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@v5.4.3 + uses: codecov/codecov-action@v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml diff --git a/.github/workflows/test-integrations-tasks.yml b/.github/workflows/test-integrations-tasks.yml index 13c34224be..868d43a6f0 100644 --- a/.github/workflows/test-integrations-tasks.yml +++ b/.github/workflows/test-integrations-tasks.yml @@ -102,7 +102,7 @@ jobs: coverage xml - name: Upload coverage to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@v5.4.3 + uses: codecov/codecov-action@v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml @@ -196,7 +196,7 @@ jobs: coverage xml - name: Upload coverage to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@v5.4.3 + uses: codecov/codecov-action@v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml diff --git a/.github/workflows/test-integrations-web-1.yml b/.github/workflows/test-integrations-web-1.yml index e52a903208..87c0054362 100644 --- a/.github/workflows/test-integrations-web-1.yml +++ b/.github/workflows/test-integrations-web-1.yml @@ -97,7 +97,7 @@ jobs: coverage xml - name: Upload coverage to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@v5.4.3 + uses: codecov/codecov-action@v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml diff --git a/.github/workflows/test-integrations-web-2.yml b/.github/workflows/test-integrations-web-2.yml index c703cfafce..a991d4f84f 100644 --- a/.github/workflows/test-integrations-web-2.yml +++ b/.github/workflows/test-integrations-web-2.yml @@ -103,7 +103,7 @@ jobs: coverage xml - name: Upload coverage to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@v5.4.3 + uses: codecov/codecov-action@v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml @@ -198,7 +198,7 @@ jobs: coverage xml - name: Upload coverage to Codecov if: ${{ !cancelled() }} - uses: codecov/codecov-action@v5.4.3 + uses: codecov/codecov-action@v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml diff --git a/scripts/split_tox_gh_actions/templates/test_group.jinja b/scripts/split_tox_gh_actions/templates/test_group.jinja index 96faefc54e..b81e964a18 100644 --- a/scripts/split_tox_gh_actions/templates/test_group.jinja +++ b/scripts/split_tox_gh_actions/templates/test_group.jinja @@ -100,7 +100,7 @@ - name: Upload coverage to Codecov if: {% raw %}${{ !cancelled() }}{% endraw %} - uses: codecov/codecov-action@v5.4.3 + uses: codecov/codecov-action@v5.5.0 with: token: {% raw %}${{ secrets.CODECOV_TOKEN }}{% endraw %} files: coverage.xml From a2a9413372130a90247a59fe1b275d508258f926 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Aug 2025 10:43:56 +0000 Subject: [PATCH 4/8] build(deps): bump actions/setup-java from 4 to 5 (#4716) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/setup-java](https://github.com/actions/setup-java) from 4 to 5.
Release notes

Sourced from actions/setup-java's releases.

v5.0.0

What's Changed

Breaking Changes

Make sure your runner is updated to this version or newer to use this release. v2.327.1 Release Notes

Dependency Upgrades

Bug Fixes

New Contributors

Full Changelog: https://github.com/actions/setup-java/compare/v4...v5.0.0

v4.7.1

What's Changed

Documentation changes

Dependency updates:

Full Changelog: https://github.com/actions/setup-java/compare/v4...v4.7.1

v4.7.0

What's Changed

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/setup-java&package-manager=github_actions&previous-version=4&new-version=5)](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) ---
Dependabot commands and options
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 merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show 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)
--------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ivana Kellyer --- .github/workflows/test-integrations-tasks.yml | 4 ++-- scripts/split_tox_gh_actions/templates/test_group.jinja | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-integrations-tasks.yml b/.github/workflows/test-integrations-tasks.yml index 868d43a6f0..fa8e405d7f 100644 --- a/.github/workflows/test-integrations-tasks.yml +++ b/.github/workflows/test-integrations-tasks.yml @@ -47,7 +47,7 @@ jobs: - name: Start Redis uses: supercharge/redis-github-action@1.8.0 - name: Install Java - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: 'temurin' java-version: '21' @@ -141,7 +141,7 @@ jobs: - name: Start Redis uses: supercharge/redis-github-action@1.8.0 - name: Install Java - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: 'temurin' java-version: '21' diff --git a/scripts/split_tox_gh_actions/templates/test_group.jinja b/scripts/split_tox_gh_actions/templates/test_group.jinja index b81e964a18..9c30cd1a75 100644 --- a/scripts/split_tox_gh_actions/templates/test_group.jinja +++ b/scripts/split_tox_gh_actions/templates/test_group.jinja @@ -61,7 +61,7 @@ {% if needs_java %} - name: Install Java - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: 'temurin' java-version: '21' From 28d0dddf41b7c10f9ba056aee659d2da4d490fbe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Aug 2025 10:46:36 +0000 Subject: [PATCH 5/8] build(deps): bump actions/checkout from 4.2.2 to 5.0.0 (#4709) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.2 to 5.0.0.
Release notes

Sourced from actions/checkout's releases.

v5.0.0

What's Changed

⚠️ Minimum Compatible Runner Version

v2.327.1
Release Notes

Make sure your runner is updated to this version or newer to use this release.

Full Changelog: https://github.com/actions/checkout/compare/v4...v5.0.0

v4.3.0

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v4...v4.3.0

Changelog

Sourced from actions/checkout's changelog.

V5.0.0

V4.3.0

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=4.2.2&new-version=5.0.0)](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) ---
Dependabot commands and options
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 merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show 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)
--------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ivana Kellyer --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test-integrations-ai.yml | 4 ++-- .github/workflows/test-integrations-cloud.yml | 4 ++-- .github/workflows/test-integrations-common.yml | 2 +- .github/workflows/test-integrations-dbs.yml | 4 ++-- .github/workflows/test-integrations-flags.yml | 2 +- .github/workflows/test-integrations-gevent.yml | 2 +- .github/workflows/test-integrations-graphql.yml | 2 +- .github/workflows/test-integrations-misc.yml | 2 +- .github/workflows/test-integrations-network.yml | 4 ++-- .github/workflows/test-integrations-tasks.yml | 4 ++-- .github/workflows/test-integrations-web-1.yml | 2 +- .github/workflows/test-integrations-web-2.yml | 4 ++-- scripts/split_tox_gh_actions/templates/test_group.jinja | 2 +- 16 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03ed8de742..ffc0a741fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: timeout-minutes: 10 steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 with: python-version: 3.12 @@ -39,7 +39,7 @@ jobs: timeout-minutes: 10 steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 with: python-version: 3.12 @@ -58,7 +58,7 @@ jobs: timeout-minutes: 10 steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 with: python-version: 3.12 @@ -89,7 +89,7 @@ jobs: timeout-minutes: 10 steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 with: python-version: 3.12 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index d824757ee9..74664add46 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -48,7 +48,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4.2.2 + uses: actions/checkout@v5.0.0 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 066c58595d..f5e952d0de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: with: app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 with: token: ${{ steps.token.outputs.token }} fetch-depth: 0 diff --git a/.github/workflows/test-integrations-ai.yml b/.github/workflows/test-integrations-ai.yml index 702496acd9..a784f9fc47 100644 --- a/.github/workflows/test-integrations-ai.yml +++ b/.github/workflows/test-integrations-ai.yml @@ -38,7 +38,7 @@ jobs: # Use Docker container only for Python 3.6 container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }} steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 if: ${{ matrix.python-version != '3.6' }} with: @@ -117,7 +117,7 @@ jobs: # Use Docker container only for Python 3.6 container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }} steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 if: ${{ matrix.python-version != '3.6' }} with: diff --git a/.github/workflows/test-integrations-cloud.yml b/.github/workflows/test-integrations-cloud.yml index c64c955855..a04d57497a 100644 --- a/.github/workflows/test-integrations-cloud.yml +++ b/.github/workflows/test-integrations-cloud.yml @@ -42,7 +42,7 @@ jobs: # Use Docker container only for Python 3.6 container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }} steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 if: ${{ matrix.python-version != '3.6' }} with: @@ -121,7 +121,7 @@ jobs: # Use Docker container only for Python 3.6 container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }} steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 if: ${{ matrix.python-version != '3.6' }} with: diff --git a/.github/workflows/test-integrations-common.yml b/.github/workflows/test-integrations-common.yml index dc46d8d475..1c0c9b80d2 100644 --- a/.github/workflows/test-integrations-common.yml +++ b/.github/workflows/test-integrations-common.yml @@ -38,7 +38,7 @@ jobs: # Use Docker container only for Python 3.6 container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }} steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 if: ${{ matrix.python-version != '3.6' }} with: diff --git a/.github/workflows/test-integrations-dbs.yml b/.github/workflows/test-integrations-dbs.yml index aa938a3ccb..5fc0be029b 100644 --- a/.github/workflows/test-integrations-dbs.yml +++ b/.github/workflows/test-integrations-dbs.yml @@ -56,7 +56,7 @@ jobs: # Use Docker container only for Python 3.6 container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }} steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 if: ${{ matrix.python-version != '3.6' }} with: @@ -155,7 +155,7 @@ jobs: # Use Docker container only for Python 3.6 container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }} steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 if: ${{ matrix.python-version != '3.6' }} with: diff --git a/.github/workflows/test-integrations-flags.yml b/.github/workflows/test-integrations-flags.yml index 64529064e9..f744f514ee 100644 --- a/.github/workflows/test-integrations-flags.yml +++ b/.github/workflows/test-integrations-flags.yml @@ -38,7 +38,7 @@ jobs: # Use Docker container only for Python 3.6 container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }} steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 if: ${{ matrix.python-version != '3.6' }} with: diff --git a/.github/workflows/test-integrations-gevent.yml b/.github/workflows/test-integrations-gevent.yml index f8babbecee..382e6a5f15 100644 --- a/.github/workflows/test-integrations-gevent.yml +++ b/.github/workflows/test-integrations-gevent.yml @@ -38,7 +38,7 @@ jobs: # Use Docker container only for Python 3.6 container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }} steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 if: ${{ matrix.python-version != '3.6' }} with: diff --git a/.github/workflows/test-integrations-graphql.yml b/.github/workflows/test-integrations-graphql.yml index 454bc1d5ea..93675fb4fe 100644 --- a/.github/workflows/test-integrations-graphql.yml +++ b/.github/workflows/test-integrations-graphql.yml @@ -38,7 +38,7 @@ jobs: # Use Docker container only for Python 3.6 container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }} steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 if: ${{ matrix.python-version != '3.6' }} with: diff --git a/.github/workflows/test-integrations-misc.yml b/.github/workflows/test-integrations-misc.yml index b049ad5642..e8937708bc 100644 --- a/.github/workflows/test-integrations-misc.yml +++ b/.github/workflows/test-integrations-misc.yml @@ -38,7 +38,7 @@ jobs: # Use Docker container only for Python 3.6 container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }} steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 if: ${{ matrix.python-version != '3.6' }} with: diff --git a/.github/workflows/test-integrations-network.yml b/.github/workflows/test-integrations-network.yml index a79dc0dd2b..867681d3a3 100644 --- a/.github/workflows/test-integrations-network.yml +++ b/.github/workflows/test-integrations-network.yml @@ -38,7 +38,7 @@ jobs: # Use Docker container only for Python 3.6 container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }} steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 if: ${{ matrix.python-version != '3.6' }} with: @@ -105,7 +105,7 @@ jobs: # Use Docker container only for Python 3.6 container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }} steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 if: ${{ matrix.python-version != '3.6' }} with: diff --git a/.github/workflows/test-integrations-tasks.yml b/.github/workflows/test-integrations-tasks.yml index fa8e405d7f..a489f64410 100644 --- a/.github/workflows/test-integrations-tasks.yml +++ b/.github/workflows/test-integrations-tasks.yml @@ -38,7 +38,7 @@ jobs: # Use Docker container only for Python 3.6 container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }} steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 if: ${{ matrix.python-version != '3.6' }} with: @@ -132,7 +132,7 @@ jobs: # Use Docker container only for Python 3.6 container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }} steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 if: ${{ matrix.python-version != '3.6' }} with: diff --git a/.github/workflows/test-integrations-web-1.yml b/.github/workflows/test-integrations-web-1.yml index 87c0054362..ba802faa01 100644 --- a/.github/workflows/test-integrations-web-1.yml +++ b/.github/workflows/test-integrations-web-1.yml @@ -56,7 +56,7 @@ jobs: # Use Docker container only for Python 3.6 container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }} steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 if: ${{ matrix.python-version != '3.6' }} with: diff --git a/.github/workflows/test-integrations-web-2.yml b/.github/workflows/test-integrations-web-2.yml index a991d4f84f..e79a54ef67 100644 --- a/.github/workflows/test-integrations-web-2.yml +++ b/.github/workflows/test-integrations-web-2.yml @@ -38,7 +38,7 @@ jobs: # Use Docker container only for Python 3.6 container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }} steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 if: ${{ matrix.python-version != '3.6' }} with: @@ -133,7 +133,7 @@ jobs: # Use Docker container only for Python 3.6 container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }} steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 if: ${{ matrix.python-version != '3.6' }} with: diff --git a/scripts/split_tox_gh_actions/templates/test_group.jinja b/scripts/split_tox_gh_actions/templates/test_group.jinja index 9c30cd1a75..4ac0d03eb2 100644 --- a/scripts/split_tox_gh_actions/templates/test_group.jinja +++ b/scripts/split_tox_gh_actions/templates/test_group.jinja @@ -42,7 +42,7 @@ # Use Docker container only for Python 3.6 {% raw %}container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }}{% endraw %} steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5.0.0 - uses: actions/setup-python@v5 {% raw %}if: ${{ matrix.python-version != '3.6' }}{% endraw %} with: From eee4c4b0186c8aed964151a8e2af56420b7ad288 Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Tue, 26 Aug 2025 09:53:37 +0200 Subject: [PATCH 6/8] fix(openai-agents): Isolate agent run (#4720) It looks like we're running into https://github.com/getsentry/sentry-python/issues/4718 (and probably https://github.com/getsentry/sentry-python/issues/4690) because the different agent runs are not properly isolated. This only seems to be a problem when multiple agent runs are awaited at once (e.g. via `asyncio.gather`) -- it seems that leads to some scope bleed. ```python import asyncio import sentry_sdk from agents import Agent, Runner from sentry_sdk.integrations.asyncio import AsyncioIntegration from sentry_sdk.integrations.openai_agents import OpenAIAgentsIntegration sentry_sdk.init(...) main_agent = Agent( name="main_agent", model="gpt-5", ) async def run_agent() -> None: runner = await Runner.run( starting_agent=main_agent, input="How are you?", ) print(runner.final_output) async def main() -> None: await asyncio.gather(*[run_agent() for _ in range(2)]) # throws an error # await asyncio.gather(run_agent()) # works ``` --- .../openai_agents/patches/agent_run.py | 3 -- .../openai_agents/patches/runner.py | 33 +++++++------- .../openai_agents/test_openai_agents.py | 43 +++++++++++++++++++ 3 files changed, 61 insertions(+), 18 deletions(-) diff --git a/sentry_sdk/integrations/openai_agents/patches/agent_run.py b/sentry_sdk/integrations/openai_agents/patches/agent_run.py index 084100878c..29002f6619 100644 --- a/sentry_sdk/integrations/openai_agents/patches/agent_run.py +++ b/sentry_sdk/integrations/openai_agents/patches/agent_run.py @@ -1,7 +1,6 @@ from functools import wraps from sentry_sdk.integrations import DidNotEnable - from ..spans import invoke_agent_span, update_invoke_agent_span, handoff_span from typing import TYPE_CHECKING @@ -9,7 +8,6 @@ if TYPE_CHECKING: from typing import Any, Optional - try: import agents except ImportError: @@ -62,7 +60,6 @@ def _get_current_agent(context_wrapper): async def patched_run_single_turn(cls, *args, **kwargs): # type: (agents.Runner, *Any, **Any) -> Any """Patched _run_single_turn that creates agent invocation spans""" - agent = kwargs.get("agent") context_wrapper = kwargs.get("context_wrapper") should_run_agent_start_hooks = kwargs.get("should_run_agent_start_hooks") diff --git a/sentry_sdk/integrations/openai_agents/patches/runner.py b/sentry_sdk/integrations/openai_agents/patches/runner.py index e1e9a3b50c..745f30a38e 100644 --- a/sentry_sdk/integrations/openai_agents/patches/runner.py +++ b/sentry_sdk/integrations/openai_agents/patches/runner.py @@ -23,20 +23,23 @@ def _create_run_wrapper(original_func): @wraps(original_func) async def wrapper(*args, **kwargs): # type: (*Any, **Any) -> Any - agent = args[0] - with agent_workflow_span(agent): - result = None - try: - result = await original_func(*args, **kwargs) - return result - except Exception as exc: - _capture_exception(exc) - - # It could be that there is a "invoke agent" span still open - current_span = sentry_sdk.get_current_span() - if current_span is not None and current_span.timestamp is None: - current_span.__exit__(None, None, None) - - raise exc from None + # Isolate each workflow so that when agents are run in asyncio tasks they + # don't touch each other's scopes + with sentry_sdk.isolation_scope(): + agent = args[0] + with agent_workflow_span(agent): + result = None + try: + result = await original_func(*args, **kwargs) + return result + except Exception as exc: + _capture_exception(exc) + + # It could be that there is a "invoke agent" span still open + current_span = sentry_sdk.get_current_span() + if current_span is not None and current_span.timestamp is None: + current_span.__exit__(None, None, None) + + raise exc from None return wrapper diff --git a/tests/integrations/openai_agents/test_openai_agents.py b/tests/integrations/openai_agents/test_openai_agents.py index 3f64e5c45c..09fca2fbf3 100644 --- a/tests/integrations/openai_agents/test_openai_agents.py +++ b/tests/integrations/openai_agents/test_openai_agents.py @@ -1,3 +1,4 @@ +import asyncio import re import pytest from unittest.mock import MagicMock, patch @@ -637,3 +638,45 @@ async def test_error_handling(sentry_init, capture_events, test_agent): assert ai_client_span["description"] == "chat gpt-4" assert ai_client_span["origin"] == "auto.ai.openai_agents" assert ai_client_span["tags"]["status"] == "internal_error" + + +@pytest.mark.asyncio +async def test_multiple_agents_asyncio( + sentry_init, capture_events, test_agent, mock_model_response +): + """ + Test that multiple agents can be run at the same time in asyncio tasks + without interfering with each other. + """ + + with patch.dict(os.environ, {"OPENAI_API_KEY": "test-key"}): + with patch( + "agents.models.openai_responses.OpenAIResponsesModel.get_response" + ) as mock_get_response: + mock_get_response.return_value = mock_model_response + + sentry_init( + integrations=[OpenAIAgentsIntegration()], + traces_sample_rate=1.0, + ) + + events = capture_events() + + async def run(): + await agents.Runner.run( + starting_agent=test_agent, + input="Test input", + run_config=test_run_config, + ) + + await asyncio.gather(*[run() for _ in range(3)]) + + assert len(events) == 3 + txn1, txn2, txn3 = events + + assert txn1["type"] == "transaction" + assert txn1["transaction"] == "test_agent workflow" + assert txn2["type"] == "transaction" + assert txn2["transaction"] == "test_agent workflow" + assert txn3["type"] == "transaction" + assert txn3["transaction"] == "test_agent workflow" From c2a21aada390aa28ca4ccf7880fe1e5fde31ac52 Mon Sep 17 00:00:00 2001 From: getsentry-bot Date: Tue, 26 Aug 2025 07:59:20 +0000 Subject: [PATCH 7/8] release: 2.35.1 --- CHANGELOG.md | 11 +++++++++++ docs/conf.py | 2 +- sentry_sdk/consts.py | 2 +- setup.py | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e06e61e32..c88533ebe3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 2.35.1 + +### Various fixes & improvements + +- fix(openai-agents): Isolate agent run (#4720) by @sentrivana +- build(deps): bump actions/checkout from 4.2.2 to 5.0.0 (#4709) by @dependabot +- build(deps): bump actions/setup-java from 4 to 5 (#4716) by @dependabot +- build(deps): bump codecov/codecov-action from 5.4.3 to 5.5.0 (#4717) by @dependabot +- build(deps): bump actions/create-github-app-token from 2.1.0 to 2.1.1 (#4710) by @dependabot +- fix(tracing): Do not attach stacktrace to transaction (#4713) by @Zylphrex + ## 2.35.0 ### Various fixes & improvements diff --git a/docs/conf.py b/docs/conf.py index 465e29a4e8..7ad137b9ed 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -31,7 +31,7 @@ copyright = "2019-{}, Sentry Team and Contributors".format(datetime.now().year) author = "Sentry Team and Contributors" -release = "2.35.0" +release = "2.35.1" version = ".".join(release.split(".")[:2]) # The short X.Y version. diff --git a/sentry_sdk/consts.py b/sentry_sdk/consts.py index f307e526af..2d3ab230b6 100644 --- a/sentry_sdk/consts.py +++ b/sentry_sdk/consts.py @@ -1329,4 +1329,4 @@ def _get_default_options(): del _get_default_options -VERSION = "2.35.0" +VERSION = "2.35.1" diff --git a/setup.py b/setup.py index dd91f8bb37..f16f4e3fd0 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ def get_file_text(file_name): setup( name="sentry-sdk", - version="2.35.0", + version="2.35.1", author="Sentry Team and Contributors", author_email="hello@sentry.io", url="https://github.com/getsentry/sentry-python", From fb4faf6090bae29000a1b8c4cd07dee0d25a59f4 Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Tue, 26 Aug 2025 10:08:00 +0200 Subject: [PATCH 8/8] Update CHANGELOG.md --- CHANGELOG.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c88533ebe3..a3af3f63a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,8 @@ ### Various fixes & improvements -- fix(openai-agents): Isolate agent run (#4720) by @sentrivana -- build(deps): bump actions/checkout from 4.2.2 to 5.0.0 (#4709) by @dependabot -- build(deps): bump actions/setup-java from 4 to 5 (#4716) by @dependabot -- build(deps): bump codecov/codecov-action from 5.4.3 to 5.5.0 (#4717) by @dependabot -- build(deps): bump actions/create-github-app-token from 2.1.0 to 2.1.1 (#4710) by @dependabot -- fix(tracing): Do not attach stacktrace to transaction (#4713) by @Zylphrex +- OpenAI Agents: Isolate agent run (#4720) by @sentrivana +- Tracing: Do not attach stacktrace to transaction (#4713) by @Zylphrex ## 2.35.0