-
Notifications
You must be signed in to change notification settings - Fork 5
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
Initial observer API #1
Initial observer API #1
Conversation
Signed-off-by: Yuri Shkuro <[email protected]> Signed-off-by: Hemant Kumar <[email protected]>
observer.go
Outdated
// ... | ||
// } | ||
// OnStartSpan function needs to be defined for a package exporting | ||
// metrics as well. |
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.
should this comment be here? it's a bit confusing
README.md
Outdated
As noble as our thoughts might be in fetching additional metrics (other than | ||
latency) for a span using an observer, there are some overhead costs. Not all | ||
observers need to observe all the span events, in which case, we are keeping | ||
a (or, some) handler function(s) empty. In effect, we will still call |
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.
maybe reword/simplify this phrase?
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 the new commit rephrased this and removed the other confusing comments.
observer.go
Outdated
// SpanObserver is created by the Observer and receives notifications about | ||
// other Span events. | ||
// Client tracers should define these functions for each of the span operations | ||
// which should call the registered (observer) callbacks. |
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.
don't think this sentence is useful.
Given all of the previous discussion, and the limitations we currently have due to the lack of a |
README.md
Outdated
|
||
The `otobserver` package provides an API. The (client) tracers (if they want | ||
to implement the observer interface) can implement this interface. To do | ||
that, first fetch the package using go get : |
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 description seems a bit off. The API provided by the tracers would be something like a functional option to tracer constructor that passes an Observer. The actual observer API is implemented by a 3rd party, not by the tracer itself.
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. Rephrased this in the new commit.
README.md
Outdated
|
||
and then, define the required span event callbacks. These registered | ||
callbacks would then be called on span events if an observer is created. | ||
Multiple observers can be registered for a given distributed tracer. Have a |
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.
nit: Tracers may allow registering multiple observers (i.e. s/can/may/
)
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.
Fixed.
README.md
Outdated
As noble as our thoughts might be in fetching additional metrics (other than | ||
latency) for a span using an observer, there are some overhead costs. Not all | ||
observers need to observe all the span events, in which case, we may have | ||
to keep some callback function(s) empty. In effect, we will still call these |
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.
nit: s/function(s)/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.
Fixed.
observer.go
Outdated
@@ -0,0 +1,36 @@ | |||
// Copyright (c) 2017 Hemant Kumar, IBM Corp. | |||
// (c) 2017 Yuri Shkuro, Uber Technologies, Inc. |
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.
you don't need to include this.
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 Removed that from this file and added a copyright for opentracing-contrib in the LICENSE file (following the convention in other opentracing-contrib projects).
Previous discussion and PR : opentracing/opentracing-go#135
Issue in opentracing-go : opentracing/opentracing-go#136