Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Make start_span fail if unsupported args are provided #4201

Merged
merged 16 commits into from
Apr 9, 2025

Conversation

sentrivana
Copy link
Contributor

@sentrivana sentrivana commented Mar 25, 2025

Make the Span constructor actually fail if it gets unsupported arguments, as opposed to silently ignoring them, so that folks get notified early.

Deprecating some of these in #4244

Closes #4200

Copy link

codecov bot commented Mar 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.61%. Comparing base (9977769) to head (8aabeb7).
Report is 1 commits behind head on potel-base.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@              Coverage Diff               @@
##           potel-base    #4201      +/-   ##
==============================================
+ Coverage       83.58%   83.61%   +0.03%     
==============================================
  Files             144      144              
  Lines           14661    14663       +2     
  Branches         2323     2324       +1     
==============================================
+ Hits            12254    12261       +7     
+ Misses           1688     1685       -3     
+ Partials          719      717       -2     
Files with missing lines Coverage Δ
sentry_sdk/tracing.py 80.00% <100.00%> (+0.11%) ⬆️

... and 4 files with indirect coverage changes

@sentrivana sentrivana changed the title chore: Remove start_span(sampled=X) chore: Clean up the Span interface Mar 25, 2025
@sentrivana sentrivana marked this pull request as ready for review April 4, 2025 12:02
@sentrivana sentrivana requested a review from a team as a code owner April 4, 2025 12:02
@sentrivana sentrivana requested review from antonpirker and removed request for a team April 4, 2025 12:02
@sentrivana sentrivana linked an issue Apr 4, 2025 that may be closed by this pull request
@sentrivana
Copy link
Contributor Author

Reverted the sampled removal. Let's still keep that API to make it easier for folks to upgrade.

sentrivana added a commit that referenced this pull request Apr 9, 2025
@sentrivana sentrivana changed the title chore: Clean up the Span interface chore: Make start_span fail if unsupported args are provided Apr 9, 2025
@@ -543,7 +540,7 @@ def timestamp(self):

def start_child(self, **kwargs):
# type: (**Any) -> Span
return Span(sampled=self.sampled, parent_span=self, **kwargs)
return Span(parent_span=self, **kwargs)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doesn't make sense to propagate the sampled flag to the children as it's only taken into account for root spans in the sampler (by design)

@sentrivana sentrivana merged commit 9e48965 into potel-base Apr 9, 2025
127 checks passed
@sentrivana sentrivana deleted the ivana/potel/remove-custom-sampled branch April 9, 2025 11:36
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.

Remove start_span(sampled=x) in POTel
2 participants