Skip to content

Commit

Permalink
Merge pull request #2 from basvanbeek/master
Browse files Browse the repository at this point in the history
fixed missing opentracing-go package dependencies
  • Loading branch information
hkshaw1990 authored Jun 22, 2017
2 parents a761e77 + 16860e8 commit a52f234
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

package otobserver

import opentracing "github.com/opentracing/opentracing-go"

// Observer can be registered with a Tracer to recieve notifications
// about new Spans. Tracers are not required to support the Observer API.
// The actual registration depends on the implementation, which might look
Expand All @@ -11,14 +13,18 @@ package otobserver
//
type Observer interface {
// Create and return a span observer. Called when a span starts.
// If the Observer is not interested in the given span, it must return (nil, false).
// E.g :
// func StartSpan(opName string, opts ...opentracing.StartSpanOption) {
// var sp opentracing.Span
// sso := opentracing.StartSpanOptions{}
// var spObs otobserver.SpanObserver = observer.OnStartSpan(span, opName, sso)
// ...
// }
OnStartSpan(sp Span, operationName string, options StartSpanOptions) SpanObserver
// var sp opentracing.Span
// sso := opentracing.StartSpanOptions{}
// spanObserver, ok := observer.OnStartSpan(span, opName, sso);
// if ok {
// // we have a valid SpanObserver
// }
// ...
// }
OnStartSpan(sp opentracing.Span, operationName string, options opentracing.StartSpanOptions) (SpanObserver, bool)
}

// SpanObserver is created by the Observer and receives notifications about
Expand All @@ -29,5 +35,5 @@ type SpanObserver interface {
// Callback called from opentracing.Span.SetTag()
OnSetTag(key string, value interface{})
// Callback called from opentracing.Span.Finish()
OnFinish(options FinishOptions)
OnFinish(options opentracing.FinishOptions)
}

0 comments on commit a52f234

Please sign in to comment.