Documentation
¶
Index ¶
- func ContextWithSpan(span opentracing.Span)
- func SpanFromContext() opentracing.Span
- func StartSpanFromContext(operationName string, opts ...opentracing.StartSpanOption) opentracing.Span
- func StartSpanFromContextWithTracer(tracer opentracing.Tracer, operationName string, ...) opentracing.Span
- type Response
- func Delete(serviceAddr string, apiPath string, payload interface{}, ...) (Response, error)
- func Get(serviceAddr string, apiPath string, payload interface{}, ...) (Response, error)
- func Patch(serviceAddr string, apiPath string, payload interface{}, ...) (Response, error)
- func Post(serviceAddr string, apiPath string, payload interface{}, ...) (Response, error)
- func Put(serviceAddr string, apiPath string, payload interface{}, ...) (Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithSpan ¶
func ContextWithSpan(span opentracing.Span)
ContextWithSpan set the global parent span in spaopentracing middleware ActiveSpan.
func SpanFromContext ¶
func SpanFromContext() opentracing.Span
SpanFromContext returns the `Span` previously setted by opentracing middleware, or `nil` if no such `Span` could be found.
func StartSpanFromContext ¶
func StartSpanFromContext(operationName string, opts ...opentracing.StartSpanOption) opentracing.Span
StartSpanFromContext starts and returns a Span with `operationName`, using any Span found within `ctx` as a ChildOfRef. If no such parent could be found, StartSpanFromContext creates a root (parentless) Span.
The second return value is a context.Context object built around the returned Span.
Example usage:
SomeFunction(ctx context.Context, ...) { sp, ctx := opentracing.StartSpanFromContext(ctx, "SomeFunction") defer sp.Finish() ... }
func StartSpanFromContextWithTracer ¶
func StartSpanFromContextWithTracer(tracer opentracing.Tracer, operationName string, opts ...opentracing.StartSpanOption) opentracing.Span
StartSpanFromContextWithTracer starts and returns a span with `operationName` using a span found within the context as a ChildOfRef. If that doesn't exist it creates a root span. It also returns a context.Context object built around the returned span.
It's behavior is identical to StartSpanFromContext except that it takes an explicit tracer as opposed to using the global tracer.