Skip to content
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

What's the recommended guideline for generating parent-id? #412

Closed
prakashjmsft opened this issue Jun 8, 2020 · 5 comments · Fixed by #426
Closed

What's the recommended guideline for generating parent-id? #412

prakashjmsft opened this issue Jun 8, 2020 · 5 comments · Fixed by #426
Assignees
Milestone

Comments

@prakashjmsft
Copy link

prakashjmsft commented Jun 8, 2020

From here - https://www.w3.org/TR/trace-context/#parent-id

This is the ID of this request as known by the caller (in some tracing systems, this is known as the span-id, where a span is the execution of a client request). It is represented as an 8-byte array, for example, 00f067aa0ba902b7. All bytes as zero (0000000000000000) is considered an invalid value.

Vendors MUST ignore the traceparent when the parent-id is invalid (for example, if it contains non-lowercase hex characters).

Current guidelines for parent-id mentions this should be an 8-byte array. But, we are missing guidelines/recommendations that this should be locally unique within the context of a trace? Also, how have SDKs implemented this to ensure span-id is unique within the context of a trace? We need to elaborate the guidelines similar to trace-id - https://www.w3.org/TR/trace-context/#considerations-for-trace-id-field-generation

@dyladan
Copy link
Member

dyladan commented Jun 8, 2020

Looks like https://www.w3.org/TR/trace-context/#privacy-of-traceparent-field is the only place where it is even mentioned.

The traceparent field is comprised of randomly-generated numbers.

We should probably add some wording for v2.

@justinfoote
Copy link
Member

Agreed.
In fact, I think sections 8.1 and 8.2 could both apply as-written to parent-id as well as trace-id.

Section 8 is non-normative. Do we need to wait until version 2 to add guidelines?

@yurishkuro
Copy link
Member

I am not in favor of being strict about HOW the IDs are generated, it's enough to describe what expectations they should satisfy, like "best-effort to be unique within the trace" for span id.

@justinfoote
Copy link
Member

OK, I can see this argument, and I like where you're going with the wording.

Still, can we add a non-normative parent id guideline without waiting until V2? Do we want to?

@danielkhan danielkhan self-assigned this Jul 28, 2020
@danielkhan danielkhan added this to the 7. level-2 milestone Sep 22, 2020
@dyladan
Copy link
Member

dyladan commented Sep 22, 2020

As discussed at the previous meeting, I will create a PR which adds non-normative wording suggesting trace ids should be unique, and that span ids should be unique within the trace. Randomness will not be required, but I may suggest it as a simple approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants