-
Notifications
You must be signed in to change notification settings - Fork 657
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
is_valid is currently a method on the SpanContext, the spec defines it as a bool flag #996
Comments
In the linked document it is simply described as "an API that returns a boolean value [...]". What would be the difference between a flag and a method here? Should it simply be defined as an attribute during instantiation, as is the case with |
@ffe4 right, the discrepancy between |
Actually I would think "returns" indicates that it is a method. So instead of changing is_valid into a property, I would think we should change is_remote to a function. Java seems to be taking this approach. |
@lzchen In Java they also use getter methods, so using a method might be more natural. However, Go and Ruby also seem to use methods. We can also have them as properties, with the same semantics but an actual "return". In that sense, I think having them as data attributes / properties would be more flexible. Another thought might be to have the same semantics everywhere in the codebase, but while I feel like properties are more idiomatic for boolean flags, but that might just be because of the libraries I'm using (e.g. requests) |
Another note while we are on the topic of wording. The specification explicitly uses flag for |
To be compliant with the tracing spec, we need a
is_valid
to be a boolean flag rather than a method on theSpanContext
https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#spancontext
The text was updated successfully, but these errors were encountered: