-
Notifications
You must be signed in to change notification settings - Fork 182
Set the scope_manager RFC to Test. #122
Set the scope_manager RFC to Test. #122
Conversation
specification.md
Outdated
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This says it returns a Scope
, but the title implies returning a Span
.
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.
Oh yes, think we should tune that in.
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 I think it should be Scope
, regardless the name we have in our implementations.
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.
Generally LGTM
specification.md
Outdated
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think it makes more sense to make it clear at all moments that Scope
objects are being returned/used.
specification.md
Outdated
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scope
sufix -> Scope
suffix?
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.
name of the method or name of the span?
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.
Oh, method name ;) Will clarify that.
specification.md
Outdated
@@ -250,6 +277,46 @@ In OpenTracing we force `SpanContext` instances to be **immutable** in order to | |||
|
|||
This is modeled in different ways depending on the language, but semantically the caller should be able to efficiently iterate through all baggage items in one pass given a `SpanContext` instance. | |||
|
|||
### `ScopeManager` | |||
|
|||
The `ScopeManager` interface sets and retrieves the active `Span`, working along the `Scope` container interface. |
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.
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.
specification.md
Outdated
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name of the method or name of the span?
specification.md
Outdated
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to resolve opentracing/opentracing-java#267 before adding this to the spec
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'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 😉
specification.md
Outdated
|
||
### `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: |
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.
and it not guaranteed
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). |
@@ -1,6 +1,6 @@ | |||
# Scope Manager | |||
|
|||
**Current State:** Draft | |||
**Current State:** Test |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
ScopeManager
RFC.Notes:
Scope
s are not thread-safe.null
the 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