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.
Click to show internal directories.
Click to hide internal directories.