metrics

package
v1.8.25 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StatRequestSaturationGauge = promauto.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "http_request_saturation",
			Help: "The total number of requests inside the server (transactions serving)",
		}, []string{"method", "protocol", "path"})

	StatBuildInfo = promauto.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "service_build_info",
			Help: "A metric with a constant '1' value labeled by version, revision, branch, and goversion from which the service was built",
		}, []string{"service", "revision", "branch", "version", "author", "build_date", "build_user", "build_host"})

	StatHTTPRequestCount = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "http_request_total",
			Help: "The total number of incoming requests to the service",
		}, []string{"method", "protocol", "path"})

	StatHTTPResponseCount = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "http_response_total",
			Help: "The total number of outgoing responses to the client",
		}, []string{"code", "method", "protocol", "path"})

	StatRequestDurationHistogram = promauto.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "http_request_duration_seconds",
			Help:    "time spent processing an http request in seconds",
			Buckets: prometheus.ExponentialBuckets(0.01, 1.6, 20),
		}, []string{"method", "protocol", "path"})
)

Functions

func StartMetricsServer

func StartMetricsServer(port int) *http.Server

Types

This section is empty.

Jump to

Keyboard shortcuts

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