-
Notifications
You must be signed in to change notification settings - Fork 589
ref: Add support for custom sampling context to span first (14) #5628
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
Merged
sentrivana
merged 96 commits into
master
from
ivana/span-first-14-custom-sampling-context
Mar 11, 2026
+98
−20
Merged
Changes from all commits
Commits
Show all changes
96 commits
Select commit
Hold shift + click to select a range
946decc
ref: Remove flag storage from StreamedSpan
sentrivana f3ee55c
ref: Tweak StreamedSpan interface
sentrivana 47ed910
Add missing logger
sentrivana 5023c76
fixes
sentrivana 6445447
ref: Add active to StreamedSpan
sentrivana 47e6211
Add property
sentrivana 1e7b694
ref: Add no-op streaming span class
sentrivana 80bfe5a
Remove redundant stuff
sentrivana 1f0ffc1
Merge branch 'master' into ivana/span-first-4-add-noop-span
sentrivana d773428
ref: Add experimental streaming API
sentrivana 647fa79
reformat
sentrivana 49bdbe6
Add a __repr__
sentrivana cdd8bd6
Merge branch 'master' into ivana/span-first-5-add-start-span-api
sentrivana 54f81af
ref: Add new_trace, continue_trace to span first
sentrivana 941863e
ref: Add streaming trace decorator
sentrivana 4b14e8d
Remove redundant code
sentrivana 474f8e6
simplify
sentrivana 9996e29
Merge branch 'ivana/span-first-5-add-start-span-api' into ivana/span-…
sentrivana e20d4fd
Merge branch 'ivana/span-first-6-add-continue-and-new-trace' into iva…
sentrivana f2738ff
reorder imports
sentrivana 7874a54
ref: Per-bucket limits, fix envelope chunking
sentrivana 63a9396
.
sentrivana c974d3e
add dummy __enter__, __exit__
sentrivana 5d8c238
Merge branch 'ivana/span-first-7-add-trace-decorator' into ivana/span…
sentrivana 831adae
type hint
sentrivana 656ef2e
Merge branch 'ivana/span-first-7-add-trace-decorator' into ivana/span…
sentrivana 1dcf176
remove unused import
sentrivana 0a7eae8
ref: Allow to start and finish StreamedSpans
sentrivana 6888c56
Add end, finish to noop spans
sentrivana 09e5cce
fixes
sentrivana ae2fd52
.
sentrivana f223574
Correctly detect user-set parent_span=None
sentrivana 05a4157
Merge branch 'master' into ivana/span-first-5-add-start-span-api
sentrivana 9e8e60e
mypy
sentrivana 777a246
Merge branch 'ivana/span-first-5-add-start-span-api' into ivana/span-…
sentrivana 9b1e2f3
Merge branch 'ivana/span-first-6-add-continue-and-new-trace' into iva…
sentrivana e589c53
Merge branch 'ivana/span-first-7-add-trace-decorator' into ivana/span…
sentrivana 1487ea8
Merge branch 'ivana/span-first-8-bucket-based-limits-in-batcher' into…
sentrivana 1006e7b
remove unused imports
sentrivana 6c16dbf
Merge branch 'ivana/span-first-7-add-trace-decorator' into ivana/span…
sentrivana cb37a07
Merge branch 'ivana/span-first-8-bucket-based-limits-in-batcher' into…
sentrivana ad6e7cc
move where finished is set
sentrivana ba29f0c
remove finished
sentrivana d6a42b2
end_timestamp improvements
sentrivana 5e20ad3
.
sentrivana c70fae4
fix
sentrivana b995770
simplify
sentrivana 0235053
Merge branch 'master' into ivana/span-first-9-start-end
sentrivana 60217e1
ref: Add warnings to span streaming APIs
sentrivana b673a09
Merge branch 'master' into ivana/span-first-9-start-end
sentrivana d6fa965
.
sentrivana 3602f86
.
sentrivana 9f59eb0
fix
sentrivana bd8e1c9
Merge branch 'ivana/span-first-9-start-end' into ivana/span-first-10-…
sentrivana 9b3df81
Merge branch 'master' into ivana/span-first-10-random-improvements
sentrivana 8614d52
Merge branch 'master' into ivana/span-first-9-start-end
sentrivana cdee8bc
Merge branch 'ivana/span-first-9-start-end' into ivana/span-first-10-…
sentrivana 72f0968
move
sentrivana dab1970
add a guard
sentrivana 7daa720
.
sentrivana b59f3cd
move warnings
sentrivana 2f0dc01
.
sentrivana dc81637
Merge branch 'ivana/span-first-9-start-end' into ivana/span-first-10-…
sentrivana bc9f765
Merge branch 'master' into ivana/span-first-9-start-end
sentrivana 45372c1
Merge branch 'ivana/span-first-9-start-end' into ivana/span-first-10-…
sentrivana c5fcb3e
ref: Add sampling to span first
sentrivana 51342fb
add sample_rate, sample_rate to spans
sentrivana 336b643
order
sentrivana aba1b50
make private
sentrivana 1e22ed0
ref: Add _is_segment to streaming spans
sentrivana 8a77d5b
tests: Add span streaming tests
sentrivana 09b88f0
dont redefine slots
sentrivana 2ac24d3
redundant slots
sentrivana a9b33a9
Merge branch 'ivana/span-first-9-start-end' into ivana/span-first-10-…
sentrivana 4ba4351
Merge branch 'ivana/span-first-10-random-improvements' into ivana/spa…
sentrivana ed09e81
Merge branch 'ivana/span-first-11-sampling' into ivana/span-first-12-…
sentrivana 6ecad5c
Merge branch 'ivana/span-first-12-is-segment' into ivana/span-first-1…
sentrivana 12d7ff7
.
sentrivana 8e3de76
fix comp
sentrivana 2448092
unused imports
sentrivana 5d8c5f3
Merge branch 'master' into ivana/span-first-11-sampling
sentrivana 73e33ea
.
sentrivana bd9e0a3
add finished to noop span
sentrivana 918609c
.
sentrivana e850994
improvements
sentrivana f816c0a
.
sentrivana 989447d
Merge branch 'ivana/span-first-11-sampling' into ivana/span-first-12-…
sentrivana c614249
Merge branch 'ivana/span-first-12-is-segment' into ivana/span-first-1…
sentrivana fd78adf
ref: Add support for custom sampling context to span first
sentrivana cb75f15
Merge branch 'master' into ivana/span-first-13-tests
sentrivana f178dea
Merge branch 'ivana/span-first-13-tests' into ivana/span-first-14-cus…
sentrivana d1618c4
test name
sentrivana c640251
put sampling context into subdict
sentrivana 7403dd2
Merge branch 'master' into ivana/span-first-14-custom-sampling-context
sentrivana e36724e
Merge branch 'master' into ivana/span-first-14-custom-sampling-context
sentrivana 3142247
span_context
sentrivana File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to the comment Cursor made - should we consider adding validation to the value that's going be set on the
custom_sampling_context?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally you could set whatever you want on the custom sampling context, so I wouldn't validate. But mistakenly overriding existing keys is a concern. I'm thinking we could put the keys set by the SDK into their own subdictionary -- we're also doing this in the old code path with
transaction_context. Just need to think of a nice new name since there are no transactions anymore in span first.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just
span? Orspan_context? Or justcontext? Naming is hard.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
span_contextis actually the way to go -- very unique, so unlikely to collide with anything user-set, and similar totransaction_contextso there's some continuity?Went with that here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, naming is hard 😅
I think
span_contextis a great name 👍🏻