tracing

package
v1.61.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: Apache-2.0 Imports: 26 Imported by: 170

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaggageItem added in v1.47.0

func BaggageItem(ctx context.Context, key string) string

func InitOTEL added in v1.47.0

func InitOTEL(serviceName string, exporterType string, metricsFactory metrics.Factory, logger log.Factory) trace.TracerProvider

InitOTEL initializes OpenTelemetry SDK.

Types

type HTTPClient

type HTTPClient struct {
	TracerProvider trace.TracerProvider
	Client         *http.Client
}

HTTPClient wraps an http.Client with tracing instrumentation.

func NewHTTPClient added in v1.48.0

func NewHTTPClient(tp trace.TracerProvider) *HTTPClient

func (*HTTPClient) GetJSON

func (c *HTTPClient) GetJSON(ctx context.Context, _ string, url string, out any) error

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

type Mutex

type Mutex struct {
	SessionBaggageKey string
	LogFactory        log.Factory
	// 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 trace.TracerProvider, 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