Skip to content

feat(python-client): Add Sentry span instrumentation for storage operations - #602

Merged
jan-auer merged 10 commits into
mainfrom
feat/python-client-tracing
Aug 28, 2026
Merged

feat(python-client): Add Sentry span instrumentation for storage operations#602
jan-auer merged 10 commits into
mainfrom
feat/python-client-tracing

Conversation

@jan-auer

@jan-auer jan-auer commented Aug 26, 2026

Copy link
Copy Markdown
Member

This adds Sentry tracing spans to the Python client, so every request to Objectstore shows up in a trace, not just as an anonymous HTTP call. Note that this requires span streaming in the surrounding application!

Each public method that talks to Objectstore now opens a span under the objectstore.* op namespace: put, get, head, delete, the multipart methods, mint_token, and presigned_object_url. Spans always run; the Sentry SDK turns them into cheap no-ops when it is uninitialized or the transaction is unsampled.

Each span carries the usecase, the scope components, and operation-specific data (sizes, compression, found, upload IDs, and so on).

@jan-auer
jan-auer requested a review from a team as a code owner August 26, 2026 14:54
@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.31%. Comparing base (af3c793) to head (a3773e8).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #602      +/-   ##
==========================================
- Coverage   88.51%   88.31%   -0.21%     
==========================================
  Files         104       94      -10     
  Lines       17237    16527     -710     
==========================================
- Hits        15258    14595     -663     
+ Misses       1979     1932      -47     
Components Coverage Δ
Rust Backend 92.52% <ø> (ø)
Rust Client 81.97% <ø> (ø)
Python Client ∅ <ø> (∅)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread clients/python/src/objectstore_client/client.py Outdated

@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 3 potential issues.

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 3d92679. Configure here.

Comment thread clients/python/src/objectstore_client/client.py Outdated
Comment thread clients/python/src/objectstore_client/tracing.py Outdated
Comment thread clients/python/src/objectstore_client/client.py Outdated
Comment thread clients/python/src/objectstore_client/client.py Outdated
Comment thread clients/python/src/objectstore_client/tracing.py Outdated
Comment thread clients/python/src/objectstore_client/client.py Outdated
@jan-auer

Copy link
Copy Markdown
Member Author

@lcian pointed out that we need to use a new API for this to work in span streaming. Since most our services are switched over, we'll do this unconditionally.

More info on:

* main:
  release: 0.2.4
  build(python): Upgrade cryptography to 50.0.0 (#605)
  build(deps): bump setuptools from 80.9.0 to 83.0.0 (#604)
  feat(config): resolve ${file:...} and ${VAR} references in config (#599)
  feat(cogs): publish backend change streams to Kafka (#597)
  feat(cogs): report backend changes to a change stream (#595)
  feat(cogs): ChangeStream trait, preparation for backend instrumentation (#590)
  feat(cogs): Create inventory-tracker crate for storage oplog (#588)
  feat(python-client): Deprecate `propagate_traces` (#603)
  feat(python-client): Send a default User-Agent header (#601)

@lcian lcian left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@lcian

lcian commented Aug 28, 2026

Copy link
Copy Markdown
Member

Launchpad isn't using span streaming yet apparently, so for that service we won't have the spans.

Edit: well, they need to upgrade the SDK if they want to use this new version of our client, so they'll have to migrate at that point :)

@jan-auer

jan-auer commented Aug 28, 2026

Copy link
Copy Markdown
Member Author

they'll have to migrate at that point

it's not obligated to adopt span streaming, but given this is an internal service, we have an incentive to. I'm OK with not having spans there until they migrate.

@jan-auer
jan-auer enabled auto-merge (squash) August 28, 2026 11:29
@jan-auer
jan-auer merged commit 018d63c into main Aug 28, 2026
25 checks passed
@jan-auer
jan-auer deleted the feat/python-client-tracing branch August 28, 2026 11:34
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