monitor

package
v0.0.0-...-838931a Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HttpCostHistogram = prometheus.NewHistogram(prometheus.HistogramOpts{
		Name:    "otp_server_http_cost_histogram",
		Help:    "otp server http cost histogram(http请求耗时分布,单位:毫秒)",
		Buckets: []float64{10, 100, 300, 500, 1000, 3000, 10000},
	})
	HttpRespCodeHistogram = prometheus.NewHistogram(prometheus.HistogramOpts{
		Name:    "otp_server_http_response_code_histogram",
		Help:    "otp server http response status code histogram(http响应状态码)",
		Buckets: []float64{299, 499, 599},
	})
)

计算QPS: irate(otp_server_http_req_total{job="otpserver"}[1m]) 统计4xx占比: sum(rate(otp_server_http_response_code_histogram_bucket{le="499"}[5m])) - sum(rate(otp_server_http_response_code_histogram_bucket{le="299"}[5m])) 查询所有otp server指标: {__name__=~"^otp_server.*"}

Functions

func HttpRepsCode

func HttpRepsCode(code int)

func HttpReqCost

func HttpReqCost(val float64)

HttpReqCost http请求耗时

func HttpReqLimitTotal

func HttpReqLimitTotal()

HttpReqLimitTotal 被limit参数限制的http请求次数

func HttpReqTotal

func HttpReqTotal()

HttpReqTotal http请求次数

func InitPrometheusMonitor

func InitPrometheusMonitor(g *gin.Engine)

func StoreStatusError

func StoreStatusError(storeType string)

StoreStatusError store状态异常

func StoreStatusNotEnabled

func StoreStatusNotEnabled(storeType string)

StoreStatusNotEnabled store未启用

func StoreStatusRight

func StoreStatusRight(storeType string)

StoreStatusRight store状态正常

Types

This section is empty.

Jump to

Keyboard shortcuts

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