metrics

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	RequestTotal     = "http_requests_total"
	RequestsDuration = "http_request_duration_seconds"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CounterMetric added in v0.5.0

type CounterMetric interface {
	WithLabelValues(...string) prometheus.Counter
	prometheus.Collector
}

type DurationMetric added in v0.5.0

type DurationMetric interface {
	WithLabelValues(...string) prometheus.Observer
	prometheus.Collector
}

type DurationType added in v0.5.0

type DurationType int
const (
	SummaryDuration DurationType = iota
	HistogramDuration
)

type InflightMetrics added in v0.5.0

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

func NewInflightMetrics added in v0.5.0

func NewInflightMetrics(namespace, subsystem string, labels map[string]string) *InflightMetrics

func (*InflightMetrics) Collect added in v0.5.0

func (m *InflightMetrics) Collect(ch chan<- prometheus.Metric)

func (*InflightMetrics) Dec added in v0.5.0

func (m *InflightMetrics) Dec()

func (*InflightMetrics) Describe added in v0.5.0

func (m *InflightMetrics) Describe(ch chan<- *prometheus.Desc)

func (*InflightMetrics) Inc added in v0.5.0

func (m *InflightMetrics) Inc()

type LabelValuesFunc added in v0.5.0

type LabelValuesFunc func(*http.Request, int) (method string, path string, code string)

type Options added in v0.5.0

type Options struct {
	Namespace   string
	Subsystem   string
	ConstLabels prometheus.Labels
	DurationType
	Buckets     []float64
	LabelValues LabelValuesFunc
}

type RequestMetrics

type RequestMetrics interface {
	Measure(*http.Request, int, time.Duration)
	prometheus.Collector
}

func NewRequestMetrics added in v0.5.0

func NewRequestMetrics(o Options) RequestMetrics

Jump to

Keyboard shortcuts

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