[OpenTracing] Scope and ScopeManager implementation#473
Merged
delner merged 2 commits intoJun 25, 2018
Conversation
delner
commented
Jun 25, 2018
| def close | ||
| return unless equal?(manager.active) | ||
| span.finish if finish_on_close | ||
| manager.send(:set_scope, @previous_scope) |
Contributor
Author
There was a problem hiding this comment.
There's something pretty icky about this: calling a private method on another class is never desirable. But this more or less how Python was doing it, and we were trying to mirror that implementation.
Ideally, a scope manager would be asked to close, then it would call down to this Scope#close, not the other way around. But as the API is designed, there's some tight coupling between Scope and ScopeManager (as evidenced by the manager in the constructor), so I don't know if this is possible.
Kyle-Verhoog
approved these changes
Jun 25, 2018
Kyle-Verhoog
left a comment
Member
There was a problem hiding this comment.
From what I can tell looks semantically equivalent to the python implementation. 👍
delner
added a commit
that referenced
this pull request
Jul 10, 2018
* Changed: Scope to expect Span and ScopeManager. * Added: Datadog::OpenTracer::ThreadLocalScope and Manager.
delner
added a commit
that referenced
this pull request
Jul 16, 2018
* Changed: Scope to expect Span and ScopeManager. * Added: Datadog::OpenTracer::ThreadLocalScope and Manager.
delner
added a commit
that referenced
this pull request
Jul 17, 2018
* Changed: Scope to expect Span and ScopeManager. * Added: Datadog::OpenTracer::ThreadLocalScope and Manager.
delner
added a commit
that referenced
this pull request
Aug 9, 2018
* Changed: Scope to expect Span and ScopeManager. * Added: Datadog::OpenTracer::ThreadLocalScope and Manager.
delner
added a commit
that referenced
this pull request
Aug 17, 2018
* Changed: Scope to expect Span and ScopeManager. * Added: Datadog::OpenTracer::ThreadLocalScope and Manager.
delner
added a commit
that referenced
this pull request
Sep 13, 2018
* Changed: Scope to expect Span and ScopeManager. * Added: Datadog::OpenTracer::ThreadLocalScope and Manager.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request implements Scope and ScopeManager. It's more or less based off what was done in opentracing/opentracing-python#77 for consistency.