metrics

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

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

Metrics subsystem and all of the keys used by the rest client.

Variables

View Source
var (

	// To prevent cardinality explosion, only the verb is added as a label to latency metrics
	RequestLatency = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Subsystem: RestClientSubsystem,
		Name:      LatencyKey,
		Help:      "Request latency in seconds. Broken down by verb.",
		Buckets:   prometheus.ExponentialBuckets(0.001, 2, 10),
	}, []string{"verb"})
)

Functions

This section is empty.

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.

type RegistererGatherer

type RegistererGatherer interface {
	prometheus.Registerer
	prometheus.Gatherer
}

RegistererGatherer combines both parts of the API of a Prometheus registry, both the Registerer and the Gatherer interfaces.

Registry is a prometheus registry for storing metrics.

type Server

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

func NewServer

func NewServer(port int) (*Server, error)

func (*Server) Shutdown

func (s *Server) Shutdown() error

func (*Server) Start

func (s *Server) Start() (err error)

Jump to

Keyboard shortcuts

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