Documentation ¶
Overview ¶
*
- @Author: yangon
- @Description
- @Date: 2020/12/25 16:29 *
*
- @Author: yangon
- @Description
- @Date: 2020/12/25 16:48 *
*
- @Author: yangon
- @Description
- @Date: 2020/12/25 16:45 *
*
- @Author: yangon
- @Description
- @Date: 2020/12/25 16:34 *
Index ¶
- Variables
- func NewCounter(name string) prometheus.Counter
- func NewCounterVec(name string, labels []string) *prometheus.CounterVec
- func NewGauge(name string) prometheus.Gauge
- func NewGaugeVec(name string, labels []string) *prometheus.GaugeVec
- func NewHistogram(key string) prometheus.Histogram
- func NewHistogramVec(key string, labels []string) *prometheus.HistogramVec
- func NewSummary(name string) prometheus.Summary
- func NewSummaryVec(name string, labels []string) *prometheus.SummaryVec
- func Run()
- type Registry
- func (reg *Registry) NewCounter(name string) prometheus.Counter
- func (reg *Registry) NewCounterVec(name string, labels []string) *prometheus.CounterVec
- func (reg *Registry) NewGauge(name string) prometheus.Gauge
- func (reg *Registry) NewGaugeVec(name string, labels []string) *prometheus.GaugeVec
- func (reg *Registry) NewHistogram(key string) prometheus.Histogram
- func (reg *Registry) NewHistogramVec(key string, labels []string) *prometheus.HistogramVec
- func (reg *Registry) NewSummary(name string) prometheus.Summary
- func (reg *Registry) NewSummaryVec(name string, labels []string) *prometheus.SummaryVec
- func (reg *Registry) NewTimer(name string, labels []string) *TimerVec
- type TimerVec
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // TypeHTTP ... TypeHTTP = "http" // TypeGRPCUnary ... TypeGRPCUnary = "unary" // TypeGRPCStream ... TypeGRPCStream = "stream" // TypeRedis ... TypeRedis = "redis" // TypeGorm ... TypeGorm = "gorm" // TypeRocketMQ ... TypeRocketMQ = "rocketmq" // TypeWebsocket ... TypeWebsocket = "ws" // TypeMySQL ... TypeMySQL = "mysql" // CodeJob CodeJobSuccess = "ok" // CodeJobFail ... CodeJobFail = "fail" // CodeJobReentry ... CodeJobReentry = "reentry" // CodeCache CodeCacheMiss = "miss" // CodeCacheHit ... CodeCacheHit = "hit" // Namespace DefaultNamespace = "xmonitor" )
View Source
var ( // ServerHandleCounter ... 指标: 服务类型,调用方法,客户端标识,返回的状态码 ServerHandleCounter = NewCounterVec("server_handle_total", []string{"type", "method", "peer", "code"}) // ServerHandleCounter ... 指标: 服务类型,调用方法,客户端标识,返回的状态码 ServerErrorCounter = NewCounterVec("server_error_total", []string{"type", "method", "peer", "code"}) // ServerHandleHistogram ... ServerHandleHistogram = NewHistogramVec("server_handle_seconds", []string{"type", "method", "peer"}) // ClientHandleCounter ... 指标: 客户端类型,客户端名称,调用方法,目标,返回的状态码 ClientHandleCounter = NewCounterVec("client_handle_total", []string{"type", "name", "method", "peer", "code"}) // ClientHandleHistogram ... ClientHandleHistogram = NewHistogramVec("client_handle_seconds", []string{"type", "name", "method", "peer"}) // JobHandleCounter ... 指标: 类型,任务名,执行状态码 JobHandleCounter = NewCounterVec("job_handle_total", []string{"type", "name", "code"}) // JobHandleHistogram ... JobHandleHistogram = NewHistogramVec("job_handle_seconds", []string{"type", "name"}) // LibHandleHistogram ... 指标: 类型,指令,address LibHandleHistogram = NewHistogramVec("lib_handle_seconds", []string{"type", "method", "address"}) // LibHandleCounter ... LibHandleCounter = NewCounterVec("lib_handle_total", []string{"type", "method", "address", "code"}) // LibHandleSummary LibHandleSummary = NewSummaryVec("lib_handle_stats", []string{"name", "status"}) // CacheHandleCounter ... 指标: 类型,缓存名 CacheHandleCounter = NewCounterVec("cache_handle_total", []string{"type", "name", "action", "code"}) // CacheHandleHistogram ... CacheHandleHistogram = NewHistogramVec("cache_handle_seconds", []string{"type", "name", "action"}) // BuildInfoGauge ... 版本信息指标 BuildInfoGauge = NewGaugeVec("build_info", []string{"name", "mode", "app_version", "go_version", "start_time"}) )
Functions ¶
func NewCounterVec ¶
func NewCounterVec(name string, labels []string) *prometheus.CounterVec
NewCounterVec 计数器
func NewGaugeVec ¶
func NewGaugeVec(name string, labels []string) *prometheus.GaugeVec
NewGaugeVec gauge
func NewHistogramVec ¶
func NewHistogramVec(key string, labels []string) *prometheus.HistogramVec
NewHistogramVec ...
func NewSummaryVec ¶
func NewSummaryVec(name string, labels []string) *prometheus.SummaryVec
NewSummaryVec ...
Types ¶
type Registry ¶
type Registry struct { prometheus.Registerer // contains filtered or unexported fields }
func (*Registry) NewCounter ¶
func (reg *Registry) NewCounter(name string) prometheus.Counter
NewCounter ...
func (*Registry) NewCounterVec ¶
func (reg *Registry) NewCounterVec(name string, labels []string) *prometheus.CounterVec
NewCounterVec 计数器
func (*Registry) NewGauge ¶
func (reg *Registry) NewGauge(name string) prometheus.Gauge
NewGauge ...
func (*Registry) NewGaugeVec ¶
func (reg *Registry) NewGaugeVec(name string, labels []string) *prometheus.GaugeVec
NewGaugeVec gauge
func (*Registry) NewHistogram ¶
func (reg *Registry) NewHistogram(key string) prometheus.Histogram
NewHistogram ...
func (*Registry) NewHistogramVec ¶
func (reg *Registry) NewHistogramVec(key string, labels []string) *prometheus.HistogramVec
NewHistogramVec ...
func (*Registry) NewSummary ¶
func (reg *Registry) NewSummary(name string) prometheus.Summary
NewSummary ...
func (*Registry) NewSummaryVec ¶
func (reg *Registry) NewSummaryVec(name string, labels []string) *prometheus.SummaryVec
NewSummaryVec ...
type TimerVec ¶
type TimerVec struct { *prometheus.HistogramVec *prometheus.CounterVec }
Click to show internal directories.
Click to hide internal directories.