tracing

package
v1.46.0-tgt.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(serviceName string, exporterType string, metricsFactory metrics.Factory, logger log.Factory) opentracing.Tracer

Init initializes OpenTelemetry SDK and uses OTel-OpenTracing Bridge to return an OpenTracing-compatible tracer.

Types

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(copyBaggage bool, tracer opentracing.Tracer, logger log.Factory) *TracedServeMux

NewServeMux creates a new TracedServeMux.

func (*TracedServeMux) Handle

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

Handle implements http.ServeMux#Handle, which is used to register new handler.

func (*TracedServeMux) ServeHTTP

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

ServeHTTP implements http.ServeMux#ServeHTTP.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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