-
Notifications
You must be signed in to change notification settings - Fork 893
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 finishing the currently active span to tracer operations #516
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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 wouldn't call "active context management" part of the Tracer's responsibilities. I'd call it part of the context library's responsibilities. If there's something managing which context is "active", then it should provide interfaces to start-new-active-span-scope and to leave-scope. These are not Tracer interfaces, though they will use a tracer to start the new span, switching to the previous active span is not a tracer responsibility IMO.
In a C++ API, for example, you might have something like:
These are not Tracer APIs, this is a context-management API that implements active span state (IMO).
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 has been talking about doing all this through the context library but it was put off to get a release out. So right now as far as I know Tracer is responsible for this and will be for the for see-able future.
The spec also already says switching to the previous span is done by the tracer.
Things like OnEnd Span Processors are tied to a Tracer, so just like with starting a span it makes sense that ending a span is doing through the Tracer, which runs the processors.
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 Tracer gave you a Span, so
Span.End
should be sufficient, I don't see why a Tracer function is required. You may be taking a position on open-telemetry/oteps#68. I am against that proposal.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 would mean for some languages that every Span has to carry around processor information so that
span.End(Span)
knows what to do. That or keep the name/version of the tracer in each Span so it can lookup the Tracer and then call the processors.It all seems to be pushing stuff into the Span just so the Tracer isn't used to End Spans...
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.
Yes because the Span is the object that is ending. Doesn't the Span have a reference to the Tracer?
In #514 there is a lengthy discussion about "end" vs "finish", but if you follow the argument there, this proposal makes end into a transitive verb (i.e., the Tracer is Ending the Span). I believe it's even less appropriate to use End as a transitive verb than it is to use End as an intransitive verb (as we are currently doing).
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.
We don't all have the ability to use references :), so it requires copying the whole tracer structure, or just the processors into the span or using a "reference" which is really just the name/version of a tracer so it has to be looked up from a global store when ending.
All of which just to not use the Tracer to finish the Span, when clearly the Tracer is required to finish the span since all this has to be done so that the Span can access the Tracer to finish itself.