Skip to content

chore(pymongo): Remove transaction-based tracing - #7378

Merged
sentrivana merged 3 commits into
major/3.0from
ivana/major/remove-transactions-pymongo
Sep 4, 2026
Merged

chore(pymongo): Remove transaction-based tracing#7378
sentrivana merged 3 commits into
major/3.0from
ivana/major/remove-transactions-pymongo

Conversation

@sentrivana

@sentrivana sentrivana commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@linear-code

linear-code Bot commented Sep 4, 2026

Copy link
Copy Markdown

PY-2709

@sentrivana
sentrivana marked this pull request as ready for review September 4, 2026 10:33
@sentrivana
sentrivana requested a review from a team as a code owner September 4, 2026 10:33
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

88842 passed | ⏭️ 4112 skipped | Total: 92954 | Pass Rate: 95.58% | Execution Time: 284m 1s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -44752
Passed Tests 📉 -41754
Failed Tests
Skipped Tests 📉 -2998

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2268 uncovered lines.
✅ Project coverage is 90.33%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
sentry_sdk/integrations/pymongo.py 100.00% ⚠️ 1 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    90.24%    90.33%    +0.09%
==========================================
  Files          193       185        -8
  Lines        25724     23450     -2274
  Branches      9504      8594      -910
==========================================
+ Hits         23214     21182     -2032
- Misses        2510      2268      -242
- Partials      1435      1362       -73

Generated by Codecov Action

@sentrivana
sentrivana merged commit abb6d45 into major/3.0 Sep 4, 2026
149 checks passed
@sentrivana
sentrivana deleted the ivana/major/remove-transactions-pymongo branch September 4, 2026 10:35

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4a9646f. Configure here.


span = sentry_sdk.traces.start_span(
name=query, attributes=span_first_data
data = {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Session IDs leak into query text

Medium Severity

Removing command.pop("lsid", None) leaves MongoDB session IDs in the serialized command. Those IDs now appear in span names, db.query.text, and breadcrumb messages. Modern PyMongo attaches lsid to almost every command, so identical queries get unique names and session identifiers are sent to Sentry.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4a9646f. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants