Set the scope_manager RFC to Test.#122
Set the scope_manager RFC to Test.#122carlosalberto wants to merge 3 commits intoopentracing:masterfrom
Conversation
|
|
||
| There should be no parameters. | ||
|
|
||
| **Returns** a `Scope` instance containing the active `Span`, or else `null` if there's none for the current thread or execution unit. |
There was a problem hiding this comment.
This says it returns a Scope, but the title implies returning a Span.
There was a problem hiding this comment.
Oh yes, think we should tune that in.
There was a problem hiding this comment.
Yes I think it should be Scope, regardless the name we have in our implementations.
|
|
||
| There should be no parameters. | ||
|
|
||
| **Returns** the used `ScopeManager` instance to set and retrieve the active `Span`. The mentioned active instance is additinaly used by default as the implicit parent for newly created `Span`s, in case no **references** were provided. |
There was a problem hiding this comment.
"the active Span" -> "the active Scope"? or in general I think it should be clear that the ScopeManager retrieves a Scope that contains the active Span. Thoughts?
There was a problem hiding this comment.
Yeah, I think it makes more sense to make it clear at all moments that Scope objects are being returned/used.
|
|
||
| This operation does the same as **Start a new `Span`**, in addition to setting the newly created `Span` as the active instance for the current thread or execution unit through the contained `ScopeManager` instance. | ||
|
|
||
| It is **highly** encouraged that the name for this operation includes a `Scope` sufix, in order to make clear the type of the returned instance. |
There was a problem hiding this comment.
name of the method or name of the span?
There was a problem hiding this comment.
Oh, method name ;) Will clarify that.
|
|
||
| ### `ScopeManager` | ||
|
|
||
| The `ScopeManager` interface sets and retrieves the active `Span`, working along the `Scope` container interface. |
There was a problem hiding this comment.
Related to my previous comment. Here I guess the behavior is clear, but I think we may need to change something in the other paragraph.
|
|
||
| This operation does the same as **Start a new `Span`**, in addition to setting the newly created `Span` as the active instance for the current thread or execution unit through the contained `ScopeManager` instance. | ||
|
|
||
| It is **highly** encouraged that the name for this operation includes a `Scope` sufix, in order to make clear the type of the returned instance. |
There was a problem hiding this comment.
name of the method or name of the span?
|
|
||
| There should be no parameters. | ||
|
|
||
| **Returns** a `Scope` instance containing the active `Span`, or else `null` if there's none for the current thread or execution unit. |
There was a problem hiding this comment.
It would be good to resolve opentracing/opentracing-java#267 before adding this to the spec
There was a problem hiding this comment.
I'd say it's more a related effort - as part of this very PR, we need to discuss what is described in #267 (as well as opentracing/opentracing-ruby#36).
But yes, in practical terms, we need to figure those two issues above before finally merging this PR 😉
|
|
||
| ### `Scope` | ||
|
|
||
| The `Scope` interface acts as a simple container for the active `Span`,and it not guaranteed to be thread-safe. It has the following capabilities: |
|
Maybe not directly related to this PR but anyway: The doc explains the behavior of Scope / ScopeManager, but I feel like it's missing the I've implemented the scope manager part in ruby zipkin OT and we've used it in production for some time now. So far I haven't encountered a use case where a simple |
|
Hey @indrekj @pavolloffay @palazzem @tylerbenson @tedsuo I've updated the document with minor corrections and updating it based on the latest OT Java iteration (making some operations optional). Let me know. |
|
Hey @indrekj
We essentially the concept has been to separate the active |
|
Hey all! I think I've updated all the requested bits of this PR, and I think it's ready to go. If you have some time over the next days, let me know - else I will be merging it soon (remember it's still an ongoing effort and can be changed/updated later). |
| # Scope Manager | ||
|
|
||
| **Current State:** Draft | ||
| **Current State:** Test |
There was a problem hiding this comment.
Hello @carlosalberto,
I think you should not remove two ending spaces here.
They are required to split lines.
When you do want to insert a <br /> break tag using Markdown, you end a line with two or more spaces, then type return.
Currently, you have Current State and Author on the same line.
There was a problem hiding this comment.
Wouldn't a blank line between them do the same? Linters do not like trailing spaces (they even show up as red in git diff).
Alternatively, in this case it's appropriate to us bullet points for the metadata.
There was a problem hiding this comment.
Wouldn't a blank line between them do the same?
No, it wouldn't. The result won't be the same.
There was a problem hiding this comment.
Linters do not like trailing spaces
I know, but it's an issue of those linters and git.
It's not a Markdown issue.
Initial take on the
ScopeManagerRFC.Notes:
Scopes are not thread-safe.nullthe value (it hadn't been mentioned before in the Specification).start_active_span()vsstart_active_scope()debate.ScopeManager.active()(as opposed toScopeManager.activeSpan()). Prone to change based on further discussion.Please provide feedback ;)
@tedsuo @palazzem @pavolloffay @pglombardo @yurishkuro @jpkrohling @indrekj @mwear @felixbarny @cwe1ss @adriancole