Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MetricHttpServerReqCodeTotal = NewCounter(prometheus.NewCounterVec(prometheus.CounterOpts{ Namespace: "http_server", Subsystem: "requests", Name: "code_total", Help: "HTTP服务器请求响应码计数."}, []string{"caller", "path", "method", "code"}, )) MetricRpcServerReqCodeTotal = NewCounter(prometheus.NewCounterVec(prometheus.CounterOpts{ Namespace: "rpc_server", Subsystem: "requests", Name: "code_total", Help: "rpc服务器请求响应码计数."}, []string{"caller", "method", "code"})) MetricRpcClientReqCodeTotal = NewCounter(prometheus.NewCounterVec(prometheus.CounterOpts{ Namespace: "rpc_client", Subsystem: "requests", Name: "code_total", Help: "rpc客户端请求响应码计数."}, []string{"method", "code"})) )
View Source
var ( MetricHttpServerReqDur = NewHistogram(prometheus.NewHistogramVec(prometheus.HistogramOpts{ Namespace: "http_server", Subsystem: "requests", Name: "duration", Help: "http服务器请求持续时间(ms).", Buckets: []float64{5, 10, 25, 50, 100, 250, 500, 1000}}, []string{"caller", "path", "method"})) MetricRpcServerReqDur = NewHistogram(prometheus.NewHistogramVec(prometheus.HistogramOpts{ Namespace: "rpc_server", Subsystem: "requests", Name: "duration", Help: "rpc服务器请求持续时间(ms).", Buckets: []float64{5, 10, 25, 50, 100, 250, 500, 1000}}, []string{"caller", "method"})) MetricRpcClientReqDur = NewHistogram(prometheus.NewHistogramVec(prometheus.HistogramOpts{ Namespace: "rpc_client", Subsystem: "requests", Name: "duration", Help: "rpc客户端请求持续时间(ms).", Buckets: []float64{5, 10, 25, 50, 100, 250, 500, 1000}}, []string{"method"})) )
Functions ¶
func NewCounter ¶
func NewCounter(cv *prometheus.CounterVec) metrics.Counter
NewCounter 新建一个prometheus斯计数器并返回计数器.
func NewHistogram ¶
func NewHistogram(hv *prometheus.HistogramVec) metrics.Observer
NewHistogram 新的prometheus柱状图和返回柱状图.
func NewSummary ¶
func NewSummary(sv *prometheus.SummaryVec) metrics.Observer
NewSummary 新的prometheus摘要和返回摘要.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.