feat(python-client): Add Sentry span instrumentation for storage operations - #602
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ 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.
|
@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)
|
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 :) |
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. |

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, andpresigned_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).