-
Notifications
You must be signed in to change notification settings - Fork 650
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
Add default invalid SpanContext #47
Conversation
return cls(cls.DEFAULT) | ||
|
||
|
||
DEFAULT_TRACEOPTIONS = TraceOptions.get_default() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing we need to decide is whether we want these as module or class level members.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong preference, but we'd have to do the assignment (e.g. TraceOptions.DEFAULT = TraceOptions.get_default
) outside the class definition anyway.
Thanks a lot for working on this. This was important to have #41 later on. Not having classes for span/trace ids is interesting, as it definitely keeps things simple. As long as a few things are supported (such as allowing users to get an ID out of an array of bytes), we should be fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR adds a global invalid
SpanContext
and fleshes outTraceState
andTraceOptions
. Since we need this package to provide thisSpanContext
by default, this means getting some implementation in our API.I opted for simplicity instead of trying to match the structure and behavior of the java client exactly here. Note that there's no class for trace/span IDs, no precondition checks, etc. The change is only a few lines, but those lines are ripe for argument.
Compare to the java
SpanContext
and see the related classes.