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

Add default invalid SpanContext #47

Merged
merged 7 commits into from
Jul 15, 2019

Conversation

c24t
Copy link
Member

@c24t c24t commented Jul 11, 2019

This PR adds a global invalid SpanContext and fleshes out TraceState and TraceOptions. Since we need this package to provide this SpanContext 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.

@c24t c24t added the api Affects the API package. label Jul 11, 2019
return cls(cls.DEFAULT)


DEFAULT_TRACEOPTIONS = TraceOptions.get_default()
Copy link
Contributor

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.

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 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.

@carlosalberto
Copy link
Contributor

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.

Copy link
Member

@reyang reyang left a comment

Choose a reason for hiding this comment

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

LGTM

@c24t c24t merged commit 69234bd into open-telemetry:master Jul 15, 2019
@c24t c24t deleted the invalid-spancontext branch July 15, 2019 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Affects the API package.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants