Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Observer ¶
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{} // 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) }
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 like the below e.g : observer := myobserver.NewObserver() tracer := client.NewTracer(..., client.WithObserver(observer))
type SpanObserver ¶
type SpanObserver interface { // Callback called from opentracing.Span.SetOperationName() OnSetOperationName(operationName string) // Callback called from opentracing.Span.SetTag() OnSetTag(key string, value interface{}) // Callback called from opentracing.Span.Finish() OnFinish(options opentracing.FinishOptions) }
SpanObserver is created by the Observer and receives notifications about other Span events.
Click to show internal directories.
Click to hide internal directories.