metrics

package
v1.0.11625-36f076d Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

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

func New

func New(ctx context.Context) *Metrics

New creates a new Metrics for capturing metrics from http trace. the context is needed to extract the metrics provider.

func (*Metrics) GaugeName

func (m *Metrics) GaugeName() string

func (*Metrics) Gauges

func (m *Metrics) Gauges(_ context.Context) map[string][]system.TaggedValue

Gauges are instantaneous name value pairs

func (*Metrics) RoundTrip

func (m *Metrics) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip makes Metrics a http.RoundTripper. It adds reference counting to round trips to be able to count inflight requests.

func (*Metrics) WithTracer

func (m *Metrics) WithTracer(ctx context.Context, route string) context.Context

WithTracer adds the tracer onto the context for this request. nolint:funlen

func (*Metrics) Wrap

func (m *Metrics) Wrap(name string, r http.RoundTripper) http.RoundTripper

Wrap wraps r with the Metrics reference counted round tripper.

Jump to

Keyboard shortcuts

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