prometheus

package
v1.0.4-snapshot Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HttpRequestsTotal 定义一个计数器,用于记录HTTP请求总数,并包含方法、路径和状态码标签
	HttpRequestsTotal = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "http_requests_total",
			Help: "Total number of HTTP requests.",
		},
		[]string{"method", "path", "status"},
	)
	// HttpRequestDuration 定义一个直方图,用于记录HTTP请求的持续时间(单位:秒)
	HttpRequestDuration = promauto.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "http_request_duration_seconds",
			Help:    "Duration of HTTP requests in seconds.",
			Buckets: prometheus.DefBuckets,
		},
		[]string{"method", "path"},
	)
	// HttpRequestProcessing 创建一个 gauge,用于记录当前处理中的HTTP请求数量
	HttpRequestProcessing = promauto.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "http_request_processing",
			Help: "Count of HTTP requests in process.",
		},
		[]string{"method", "path"},
	)
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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