Back to godoc.org

Package tracing

v0.0.0-...-261bb52
Latest Go to latest

The highest tagged major version is .

Published: Jan 3, 2020 | License: MIT | Module: github.com/Cluas/gim

Index

func Init

func Init(serviceName string, metricsFactory metrics.Factory) (opentracing.Tracer, io.Closer)

Init creates a new instance of Jaeger tracer.

func WrapRedisClient

func WrapRedisClient(ctx context.Context, client *redis.Client) *redis.Client

WrapRedisClient adds opentracing measurements for commands and returns cloned client

type HTTPClient

type HTTPClient struct {
	Tracer opentracing.Tracer
	Client *http.Client
}

HTTPClient wraps an http.Client with tracing instrumentation.

func (*HTTPClient) GetJSON

func (c *HTTPClient) GetJSON(ctx context.Context, endpoint string, url string, out interface{}) error

GetJSON executes HTTP GET against specified url and tried to parse the response into out object.

type Mutex

type Mutex struct {
	SessionBaggageKey string
	// contains filtered or unexported fields
}

Mutex is just like the standard sync.Mutex, except that it is aware of the Context and logs some diagnostic information into the current span.

func (*Mutex) Lock

func (sm *Mutex) Lock(ctx context.Context)

Lock acquires an exclusive lock.

func (*Mutex) Unlock

func (sm *Mutex) Unlock()

Unlock releases the lock.

type TracedServeMux

type TracedServeMux struct {
	// contains filtered or unexported fields
}

TracedServeMux is a wrapper around http.ServeMux that instruments handlers for tracing.

func NewServeMux

func NewServeMux(tracer opentracing.Tracer) *TracedServeMux

NewServeMux creates a new TracedServeMux.

func (*TracedServeMux) Handle

func (tm *TracedServeMux) Handle(pattern string, handler http.Handler)

Handle implements http.ServeMux#Handle

func (*TracedServeMux) ServeHTTP

func (tm *TracedServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.ServeMux#ServeHTTP

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier