-
Notifications
You must be signed in to change notification settings - Fork 893
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
W3C TraceState underspecified #759
Comments
I still think
(Note that #510 is still open required-for GA, P2) As for the TraceState part of the SpanContext: With SpanContext being required to be a final/sealed class (open-telemetry/oteps#58) and in the API spec, TraceState is the only place to store custom information with the SpanContext, which for example, the Dynatrace propagator and also the Dynatrace exporter requires (the propagator reads and writes routing information for the Span which the exporter uses). Note that this would not even be solvable otherwise with a fully custom SDK implementation. |
@andrewhsu are you sure it's right to classify it as @dyladan mentioned in the issue description that it would make sense to explicitly specify it as not part of the API, which should hopefully be simple and uncontroversial:
|
I just mentioned in my above comment that at least in Dynatrace's usage of the SDK, we do need some way to attach custom information to the SpanContext that is accessed in the propagators and the exporter. Whether this custom information is stored in the TraceState (the custom information is indeed stored and intentionally propagated as a W3C tracestate header entry) or only for manual use by the propagator is a secondary concern, but some way to add custom information to the SpanContext is required. I would agree that the TraceState should not be accessible to instrumentations, but the current design of OpenTelemetry does not really allow this, with SpanContext being final/sealed and created in the SDK. If the SpanContext was non-final and had an overridable If #510 (Consider using Context as the unique way to specify parenthood) was implemented, then we could remove the (TraceState from) SpanContext and store custom information in the Context, but only if also the exporter could get access to the full Context in which a Span was created, which may also be difficult to implement. |
I also think this is definitely required-for-ga though. |
From the spec meeting: moving it to GA to specify this |
per spec SIG meeting: Before GA we need to do one of the following:
|
@open-telemetry/technical-committee Can this get a priority? I'd vote for P1 since this affects an API in SpanContext, a class that is very central in the Tracing API. |
Trying to keep scope as minimal as possible, do I understand the problem correctly?
If above statements are true, then following are my answers to that. We currently specify that
So W3C specifies mutating operations on TraceState. It is also natural to assume that there should be an API to read key-values pairs from I think that by delegating to W3C specification OpenTelemetry does sufficient work of specifying TraceContext API and thus point 2. from above is invalid. Regarding the concern raised in the original comment that
W3C specifies that mutating operations are allowed to operate on arbitrary keys. Indeed, by their nature (they are vendor specific), Otel cannot limit access to any keys Taking all that into account, I think there is no need for any further actions regarding TraceContext API. Related concerns about whether this API should be available in Trace API or only to Trace SDK, and whether SpanContext should be part of the public API or not, can be addressed separately. |
I do think we should at least list the operations. We do not need to specify them in detail, but at least we need to make clear what is needed. AFAIK, some languages allow only accessing TraceState as a raw string. They would then at least need to provide utility functions. Also, TraceState is immuatable in OpenTelemetry, by SpanContext being immutable. This is not a contradiction (you can manipulate a SpanContextBuilder before creating a (child) SpanContext), but might warrant some additional API design hints. |
You don't think that linking to that list in W3C specification is enough? |
No, I don't think that's enough, as is evident by the diverging APIs in different languages. We don't have to describe each operations in detail (link to W3C should be enough) but we should list them at least. Also I wonder if we should apply all limitations (like dropping old keys if it gets too long) only at process boundaries or already in-process. I would think only at process-boundaries, as TraceState may also be used by non-W3C propagators which may different limitations / encodings of the TraceState or special keys therein. |
Ok, fair enough. Then the solution to this issue should be an amendment to the spec, which copies a list of operations on @Oberon00 @dyladan @open-telemetry/specs-trace-approvers agreed? |
Seems fine to me. The only thing that still needs to be specified is if our API to tracestate should allow you to specify your key. |
As vendors can add arbitrary keys, Otel cannot decide on them. |
I'm more and more leaning towards the larger but more future-proof change of saying that:
|
I must admit I don't see a need for such significantly more elaborate proposal. But, @Oberon00, if you have a clear vision of such new proposal, are you willing to reassign this issue to yourself and submit a PR? I was assigned this to ensure it is moving forward. Seems that you have the needed motivation to see it through. |
I think for just solving this P1 issue, the simpler proposal would also work fine. But the more elaborate proposal would additionally solve the flexibility bottleneck that is SpanContext (as discussed in #759 (comment)). It will be significantly more work however 😞 I think I will try to get at least #510 resolved to not completely close the door for this in the future and in parallel we should go forward with your suggestion #759 (comment) of just specifying an API for SpanContext. If I/someone else still proposes a PR in time, we can easily adjust that API to operate on Context instead of SpanContext as a small (yet breaking!) spec change together with the other (larger) changes I proposed. |
I was looking at the JS implementation of the tracing api as we move towards GA, and the tracestate is underspecified. There currently exists no direction on what API methods to interact with tracestate should exist, if any. The JS implementation currently as
get(key): string | undefined
,set(key, value): void
,unset(key): void
, andserialize(): string
methods. There are a few problems with this:As a solution, I recommend we specify that there is no public API to modify tracestate, and that the default sdk behavior is to propagate it unmodified for now. This leaves us open to define behavior in the future if we desire, even after GA release. If we do not specify this now, then it will be impossible to specify later without a breaking change in some SIGs.
The text was updated successfully, but these errors were encountered: