metrics

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 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

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

type DurationMetric

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

type DurationType

type DurationType int
const (
	SummaryDuration DurationType = iota
	HistogramDuration
)

type InflightMetrics

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

func NewInflightMetrics

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

func (*InflightMetrics) Collect

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

func (*InflightMetrics) Dec

func (m *InflightMetrics) Dec()

func (*InflightMetrics) Describe

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

func (*InflightMetrics) Inc

func (m *InflightMetrics) Inc()

type LabelValuesFunc

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

type Options

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

func NewRequestMetrics(o Options) RequestMetrics

Jump to

Keyboard shortcuts

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