Skip to content

Why is it not supported to modify the SpanContext in the Span, and what should I do if I need to resample? #1760

Answered by Aneurysm9
wuboui asked this question in Q&A
Discussion options

You must be logged in to vote

The specification requires that SpanContext is immutable. Resampling a span in process is potentially dangerous since other spans may have been created from it assuming the original sampling decision which can result in broken traces or otherwise lost data. It is generally only safe to either perform head sampling in the SDK or tail sampling, with all spans in a trace available for resampling, in the collector or other span aggregator.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@wuboui
Comment options

@wuboui
Comment options

@Aneurysm9
Comment options

Answer selected by Aneurysm9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1759 on March 31, 2021 14:07.