tracing

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextToHTTP

func ContextToHTTP(ctx context.Context, tracer opentracing.Tracer, req *http.Request) (nReq *http.Request)

ContextToHTTP returns an http RequestFunc that injects an OpenTracing Span found in `ctx` into the http headers. If no such Span can be found, the RequestFunc is a noop.

func ExtractSpanFromCtx

func ExtractSpanFromCtx(ctx context.Context) opentracing.Span

func ExtractTraceIDFromCtx

func ExtractTraceIDFromCtx(ctx context.Context) string

func HTTPToContext

func HTTPToContext(tracer opentracing.Tracer, req *http.Request, operationName string) context.Context

HTTPToContext returns an http RequestFunc that tries to join with an OpenTracing trace found in `req` and starts a new Span called `operationName` accordingly. If no trace could be found in `req`, the Span will be a trace root. The Span is incorporated in the returned Context and can be retrieved with opentracing.SpanFromContext(ctx).

func NewGlobalTracer

func NewGlobalTracer(name string) (opentracing.Tracer, io.Closer, error)

func Open

func Open(name string) (gin.HandlerFunc, io.Closer, error)

func OpenTracing

func OpenTracing() gin.HandlerFunc

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL