metrics

package
v0.0.0-...-2f3125f Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Subsystem           = "ALT"
	RestClientSubsystem = "rest_client"
	LatencyKey          = "request_latency_seconds"
	ResultKey           = "requests_total"
)

Variables

View Source
var (
	RequestLatency = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Subsystem: RestClientSubsystem,
		Name:      LatencyKey,
		Help:      "Request latency in seconds. Broken down by verb and URL.",
		Buckets:   prometheus.ExponentialBuckets(0.001, 2, 10),
	}, []string{"verb", "url"})
)

Functions

func ResourceCount

func ResourceCount(resource string, name string, verb string)

func ResourceErrors

func ResourceErrors(resource string, name string, verb string)

Types

type LatencyAdapter

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

LatencyAdapter implements LatencyMetric.

func (*LatencyAdapter) Observe

func (l *LatencyAdapter) Observe(_ context.Context, verb string, u url.URL, latency time.Duration)

Observe increments the request latency metric for the given verb/URL.

Jump to

Keyboard shortcuts

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