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

Specify IsValid and IsRemote as required #914

Conversation

arminru
Copy link
Member

@arminru arminru commented Sep 2, 2020

Fixes #908.

I explicitly specified both APIs as required, which I think was the initial intention.

According to the spec-compliance-matrix, only JS is known to not have implemented IsValid.
--> implemented in the meantime

Apart from that, I slightly reworded IsRemote to not have the API spec dictate how it should be implemented.

@arminru arminru requested a review from a team as a code owner September 2, 2020 08:39
@arminru arminru requested a review from a team September 2, 2020 08:39
@arminru arminru requested a review from a team as a code owner September 2, 2020 08:39
@Oberon00
Copy link
Member

Oberon00 commented Sep 2, 2020

Please fix this more generally. Right now the spec also says

The OpenTelemetry SpanContext representation conforms to the W3C TraceContext specification.

Is this a MUST?

It contains two identifiers - a TraceId and a SpanId - along with a set of common TraceFlags and system-specific TraceState values.

Are both identifiers a MUST? Are TraceFlags and TraceState a MUST?

etc

@arminru
Copy link
Member Author

arminru commented Sep 2, 2020

@Oberon00 In contrast to the two mentioned APIs, which I could interpret as "suggesting names and behavior", if implemented, the other parts can only be interpreted as given IMHO. If it would say "The OpenTelemetry SpanContext representation MUST conform to the W3C TraceContext specification.", this would impose a MUST on the spec itself (which wouldn't make any sense), rather than implementations, wouldn't it?

@Oberon00
Copy link
Member

Oberon00 commented Sep 2, 2020

You could simplify+clarify this at once by just saying "SpanContext MUST conform to the W3C TraceContext specification". The sentence you suggested does indeed sound odd.

Copy link
Member

@Oberon00 Oberon00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving this, because while incomplete it is an improvement over the current situation.

@arminru arminru changed the title Clarify IsValid and IsRemote as required Specify IsValid and IsRemote as required Sep 2, 2020
@arminru
Copy link
Member Author

arminru commented Sep 2, 2020

@Oberon00 Personally I think the current wording is fine. "SpanContext conforms to the W3C TraceContext spec" implies that anyone implementing it will also have to conform to it. When the spec says "SpanContext contains two identifiers", an implementation that only implements one is not implementing SpanContext. The section is about defining SpanContext itself and not the requirements for how SpanContext should be defined by the spec.
I could, however, rephrase it to "SpanContext implementations MUST ..." but I'm not sure if that adds value.

@@ -195,16 +195,15 @@ The API should not expose details about how they are internally stored.

### IsValid
Copy link
Member

@Oberon00 Oberon00 Sep 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just add the sentence "The API MUST provide all operations specified in the following subsections" instead?

@Oberon00
Copy link
Member

Oberon00 commented Sep 2, 2020

When the spec says "SpanContext contains two identifiers", an implementation that only implements one is not implementing SpanContext.

Does it say anywhere that SpanContext MUST be implemented?

@arminru
Copy link
Member Author

arminru commented Sep 2, 2020

@Oberon00

Does it say anywhere that SpanContext MUST be implemented?

It says:

The Span interface MUST provide:

  • An API that returns the SpanContext for the given Span.

@carlosalberto
Copy link
Contributor

Overall LGTM. Maybe you want to apply @Oberon00's suggestion in order to not have to use MUST for every operation ;)

@carlosalberto
Copy link
Contributor

@arminru Please rebase too ;)

@arminru
Copy link
Member Author

arminru commented Sep 2, 2020

@carlosalberto I think the current wording is quite fine. If I put that sentence in the section above, I would still have to write something like "There MUST be an API ..." or "An API ... MUST be provided" or at least "The API ... is defined as ...". Otherwise it will just be an odd sounding mention of some behavior, so we wouldn't save any spare words here.

The original wording does not really make up proper sentences:

"An API that returns a boolean value, which is true if the SpanContext has a non-zero TraceID and a non-zero SpanID."

"An API that returns a boolean value, which is true if the SpanContext was propagated from a remote parent."

Copy link
Member

@obecny obecny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -47,6 +47,8 @@ Updates:
([#611](https://github.com/open-telemetry/opentelemetry-specification/pull/611))
- Version attributes no longer have a prefix such as semver:
([#873](https://github.com/open-telemetry/opentelemetry-specification/pull/873))
- Explicitly specify the SpanContext APIs IsValid and IsRemote as required
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need a changelog entry for such clarifications?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't add one at first but then thought it couldn't hurt to make SIG maintainers aware of it, just in case they interpreted it differently in the past. Not all have filled out the compliance matrix yet and adding the entry was easier than inspecting the missing repos.

@carlosalberto
Copy link
Contributor

@arminru Please rebase so we can merge it.

@carlosalberto carlosalberto merged commit 6b7b2ab into open-telemetry:master Sep 3, 2020
@arminru arminru deleted the clarify-isvalid-isremote branch September 3, 2020 15:23
This pull request was closed.
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 this pull request may close these issues.

Are IsValid and IsRemote required?
6 participants