-
Notifications
You must be signed in to change notification settings - Fork 872
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
SDK: Samplers should be able to modify tracestate #856
Comments
Hey - just wanted to check, is this the same as in #854? Also, do they solve open-telemetry/opentelemetry-proto#166? That is looking at adding a dedicated field for sampling decisions but if we need to propagate it anyways, just parsing it out of tracestate seems simpler. |
From @narayaruna Use case: A -> B -> C -> D Service A doesn't sample the incoming request however the trace context is initialized and sent downstream with sampling decision set to false. |
@anuraaga this is not resolving open-telemetry/opentelemetry-proto#166, this issue asks for the ability to modify trace-state in the Sampler API, one use-case may be to record a sampling decision and propagate it, but there are other use-cases as well. Also most likely because this is a custom field in the tracestate (vendor specific) we cannot consume it in the collector. |
@bogdandrutu Thanks, I don't quite understand the point about not being able to consume in the collector. Don't we copy the trace state in as is in OTLP which would be visible in the collector? If so, my understanding is the ability to mutate trace state with sampling decisions would automatically also allow exporting it to collector too, without having to add a new field. |
I would also expect the collector to be able to consume all custom fields. It might be equipped with a vendor-specific exporter after all that needs to read vendor-specific fields. |
The collector does not know how to parse vendor specific values in the TraceState so will not be able to consume that. If we do have a OTel entry in the TraceState that may be something the collector may know how to interpret. |
Vendor-specific modules can be added to the Collector, can't they? |
Fixes #856 ## Changes Added `Tracestate` to `SamplingResult` Related [oteps](https://github.com/open-telemetry/oteps) open-telemetry/oteps#135
What are you trying to achieve?
Samplers may need to modify tracestate to enable vendor-specific sampling algorithms.
Additional context.
One of the examples is described here: open-telemetry/oteps#135, where sampling score is calculated by the first service and downstream services can still use the score instead of re-calculating it using a potentially different algorithm.
The spec does not define type for
tracestate
and implementations use simple string or have a specific type.Proposal:
Update SamplingResult to have
Tracestate
with the type used by the OTel API specific to the language.Add requirement for SDK to populate
tracestate
received from sampler on span-to-be-created.[questionable] If aggregated sampler (with nested ones) is configured, outer sampler should take care of merging tracestate. Alternative is adding
tracestate
argument toShouldSample
callback to propagate outer changes to inner samplers.The text was updated successfully, but these errors were encountered: