-
Notifications
You must be signed in to change notification settings - Fork 770
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
Expose utils to parse trace state #934
Comments
The above is coming in .NET API. It'll do entire ActivityContext, not just tracestate portion. |
@cijothomas yes!!! |
been thinking about it and decided to reopen: So this seems to be a reasonable workaround, but parsing traceparent is an overhead that ideally should be avoided for the sake of perf. |
I don't think we have intentions to add this. You can parse the whole If you feel strongly that it should be provided by OpenTelemetry, then please reopen. I don't think this is a requirement for the SDK via the specifications though. |
Is your feature request related to a problem?
Some custom samplers need to access tracestate to make sampling decision (this is on of the ways to interop with legacy custom correlation protocols). Currently such samplers would have to parse tracestate on their own.
Let's say sampler whats to check certain flag value in tracestate: 'sampling.priority=0.5'
SamplingResult ShouldSample(in SamplingParameters samplingParameters)
SamplingResult
hasActivityContext
which hasTraceState
stringDescribe the solution you'd like.
TracestateUtils
and addstatic public bool TryExtractTracestate (string tracestateString, out IEnumerable<KeyValuePair<string, string>> tracestate)
Describe alternatives you've considered.
SpanContext(ActivityContext)
or addSpanContext(traceid, spanId, flags, isRemote, tracestateString)
ctor: not great since samplers don't needSpanContext
, just the tracestate portion of itThe text was updated successfully, but these errors were encountered: