Documentation ¶
Index ¶
- func CreateSpan(ctx context.Context, spanName string, tags *map[string]interface{}) (opentracing.Span, context.Context)
- func CreateSpanFromClientContext(r *http.Request, spanName string, tags *map[string]interface{}) (opentracing.Span, context.Context)
- func ExtractFromCarrier(ctx context.Context, carrier opentracing.TextMapCarrier, spanName string, ...) (opentracing.Span, context.Context)
- func FlushCollector()
- func GetGlobalTracer() opentracing.Tracer
- func GotKitEndpointMiddleWare(operationName string) endpoint.Middleware
- func HTTPMiddleware(operationName string, next http.Handler) http.Handler
- func InjectIntoCarrier(ctx context.Context) opentracing.TextMapCarrier
- func InjectSpan(r *http.Request, options ...TraceOptions) *http.Request
- func SetGlobalTracer(options ...tracerOption) error
- func SetSpanError(span opentracing.Span, err error)
- func UsingJaeger() tracerOption
- type TraceOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSpan ¶
func CreateSpan(ctx context.Context, spanName string, tags *map[string]interface{}) (opentracing.Span, context.Context)
CreateSpan ...
func CreateSpanFromClientContext ¶
func CreateSpanFromClientContext(r *http.Request, spanName string, tags *map[string]interface{}) (opentracing.Span, context.Context)
CreateSpanFromClientContext ...
func ExtractFromCarrier ¶
func ExtractFromCarrier(ctx context.Context, carrier opentracing.TextMapCarrier, spanName string, tags *map[string]interface{}) (opentracing.Span, context.Context)
ExtractFromCarrier returns a span with context passed by the carrier ctx should not already have span in it
func FlushCollector ¶
func FlushCollector()
func GetGlobalTracer ¶
func GetGlobalTracer() opentracing.Tracer
func GotKitEndpointMiddleWare ¶ added in v0.2.0
func GotKitEndpointMiddleWare(operationName string) endpoint.Middleware
GotKitEndpointMiddleWare returns a gokit.Middleware which change the behavior of a gokit.endpoint it had tracing capability
func HTTPMiddleware ¶
HTTPMiddleware returns a Middleware that injects an OpenTracing Span found in context into the HTTP Headers.
func InjectIntoCarrier ¶
func InjectIntoCarrier(ctx context.Context) opentracing.TextMapCarrier
InjectIntoCarrier returns a textMapCarrier, basically a map[string]string,
which can be used to transmit a span context to another service with ExtractFromCarrier
func InjectSpan ¶
func InjectSpan(r *http.Request, options ...TraceOptions) *http.Request
InjectSpan ...
func SetGlobalTracer ¶
func SetGlobalTracer(options ...tracerOption) error
func UsingJaeger ¶ added in v0.3.3
func UsingJaeger() tracerOption
Pass UsingJaeger's result as argument to SetGlobalTracer to set Jaeger as your tracing system This is the default behavior
Types ¶
type TraceOptions ¶ added in v0.3.2
type TraceOptions func(*httptrace.ClientTrace, opentracing.Span)
TraceOptions represents the options of a ClientTrace