-
Notifications
You must be signed in to change notification settings - Fork 890
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
Allow samplers to modify tracestate #988
Allow samplers to modify tracestate #988
Conversation
This seems to me to contradict this:
By W3C Trace Context specification, |
Tracestate can be mutated. This change enables following scenario
Let me know if this helps. |
Workflow does make sense, thank you. I still worry about implementation. Does this mean that a new instance of SpanContext has to always be created after receiving sampling decision? Or SDK has to detect changes in TraceState? |
@iNikem Because of the new SpaId, a new SpanContext has to be created anyway. I expect implementation here to be trivial, replacing parent.tracestate with decision.tracestate |
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 think the new spec is quite confusing and unclear on what the sampler needs to do to use the parent tracestate without modification vs when the tracestate will be cleared. See my comment #988 (comment)
@Oberon00 I changed the wording as you suggested, thank you. Please have a look. |
Thank you for addressing my comments! I approved your PR, it looks great now! |
@@ -29,6 +29,8 @@ New: | |||
* `exception.escaped` semantic span event attribute was added | |||
([#784](https://github.com/open-telemetry/opentelemetry-specification/pull/784), | |||
[#946](https://github.com/open-telemetry/opentelemetry-specification/pull/946)) | |||
- Allow samplers to modify tracestate | |||
([#856](https://github.com/open-telemetry/opentelemetry-specification/pull/988/)) |
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.
([#856](https://github.com/open-telemetry/opentelemetry-specification/pull/988/)) | |
([#988](https://github.com/open-telemetry/opentelemetry-specification/pull/988/)) |
* A `Tracestate` that will be associated with the `Span` through the new | ||
`SpanContext`. | ||
Note: If the sampler returns an empty `Tracestate` here, the `Tracestate` will be cleared, | ||
so samplers should normally return the passed-in `Tracestate` if they do not intend |
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.
so samplers should normally return the passed-in `Tracestate` if they do not intend | |
so samplers SHOULD return the `Tracestate` passed to them, if they do not intend |
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.
In a Note, we should not have upper-case requirements. If you want reword it, also drop the "Note:", and probably make it a MUST
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.
@lmolkova Please add an entry in spec-compliance-matrix.md
to keep track of implementations adopting the change.
@@ -29,6 +29,8 @@ New: | |||
* `exception.escaped` semantic span event attribute was added | |||
([#784](https://github.com/open-telemetry/opentelemetry-specification/pull/784), | |||
[#946](https://github.com/open-telemetry/opentelemetry-specification/pull/946)) | |||
- Allow samplers to modify tracestate |
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.
- Allow samplers to modify tracestate | |
- Add (modified) Tracestate to the return value of Samplers |
Otherwise it sounds like something optional but this actually changed the interface and SIGs will have to implement this.
from the issue triage meeting today with TC, this looks desirable, just needs changelog update which can be a followup @carlosalberto |
Merging as agreed during triage session since it has sufficient approvals. |
- Fix CHANGELOG entry. - Use SHOULD for the tracestate change. - Add it to the compliance matrix.
Incorporating changes from open-telemetry/opentelemetry-specification#988
Add trace_state into SamplingResult. See open-telemetry/opentelemetry-specification#988 for details.
Add trace_state into SamplingResult. See open-telemetry/opentelemetry-specification#988 for details.
Add trace_state into SamplingResult. See open-telemetry/opentelemetry-specification#988 for details.
Fixes open-telemetry#856 ## Changes Added `Tracestate` to `SamplingResult` Related [oteps](https://github.com/open-telemetry/oteps) open-telemetry/oteps#135
Fixes #856
Changes
Added
Tracestate
toSamplingResult
Related oteps open-telemetry/oteps#135