Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Move context utils outside of the Tracer #527
Move context utils outside of the Tracer #527
Changes from 1 commit
9442fa3
f29a958
7248740
25365ce
b61b7fd
93d9e14
33649f0
d9a767d
57774d4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
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.
also s/TracingContextUtils/TracingContext/
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 think we need something as suffix or prefix if we want to be consistent for CorrelationContext which has
Context
at the end, because will be ugly to name thatCorrelationContextContext
:(. Any ideas?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.
If context interaction is done via static util class, then
TracingContext.activeSpan()
looks a lot better thanTracingContextUtils.activeSpan()
.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 do agree with you but I am trying to think how would I name this class for "CorrelationContext" package. If I find a good name for that and ensure consistency I am all to remove
Utils
.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.
CorrelationContext can remain CorrelationContext. It can represent both the object that stores correlations and the namespace for static functions.
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.
@yurishkuro I'd be up for not using
TraceContext
and keeping the activation bits inCorrelationContext
- we will end up with too many classes having theContext
suffix (some of them doing different things, i.e.TraceContext
doing activation handling only,CorrelationContext
doing both activation handling PLUS as a container of key-values).There was already some confusion in the past because of the fact we had both
CorrelationContext
andContext
, so this could get worse ;)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.
This sounds like logic is going into the API? Before the API was almost entirely interfaces.
Unless I'm misunderstanding this it seems instead of the Tracer simply calling to the sdk with a context and some options to start a span there is log in the API for juggling the span in the context, resulting in multiple calls from the API to the SDK?
How does this work out for the streaming SDK for example?
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.
It was my understanding that the API should never call the SDK and cannot depend on it. Otherwise it would be impossible to have third party SDKs
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.
The API is functions/methods that are implemented by the SDK, calling API functions results in whatever SDK is being used (if any) being called. Users do not call the SDK directly.
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.
@tsloughter As far as I'm aware, Context is not a part of the SDK but a third top-level item that the API and SDK depend on.