Documentation ¶
Index ¶
- func AttrGaugeAdd(metric AttrType)
- func AttrGaugeInc(metric AttrType)
- func AttrGaugeSet(metric AttrType)
- func AttrGaugeSub(metric AttrType)
- func DefaultParseAttrName(name string) string
- func GetCounter(prefix, name string, constLabel prometheus.Labels, publicKeys, rfTags []string) prometheus.Counter
- func GetCounterVec(prefix, name string, constLabel prometheus.Labels, publicKeys, rfTags []string) *prometheus.CounterVec
- func GetGauge(prefix, name string, constLabel prometheus.Labels, publicKeys, rfTags []string) prometheus.Gauge
- func GetGaugeVec(prefix, name string, constLabel prometheus.Labels, publicKeys, rfTags []string) *prometheus.GaugeVec
- func GetHistogram(prefix, name string, constLabel prometheus.Labels, publicKeys, rfTags []string) prometheus.Histogram
- func GetHistogramVec(prefix, name string, constLabel prometheus.Labels, publicKeys, rfTags []string) *prometheus.HistogramVec
- func GetSummary(prefix, name string, constLabel prometheus.Labels, publicKeys, rfTags []string) prometheus.Summary
- func GetSummaryVec(prefix, name string, constLabel prometheus.Labels, publicKeys, rfTags []string) *prometheus.SummaryVec
- func InitMetrics(prefix string, Metrics interface{}, labels prometheus.Labels, ...)
- func InitMetrics2(prefix string, Metrics interface{}, labels prometheus.Labels, ...)
- type AttrType
- type Counter
- func (c Counter) Add(metric AttrType, value int)
- func (c Counter) AttrValue() int
- func (c Counter) GetMetricWith(labels prometheus.Labels) (prometheus.Counter, error)
- func (c Counter) GetMetricWithLabelValues(lvs ...string) (prometheus.Counter, error)
- func (c Counter) Inc()
- func (c Counter) With(labels prometheus.Labels) prometheus.Counter
- func (c Counter) WithLabelValues(lvs ...string) prometheus.Counter
- type Gauge
- type Histogram
- type ParseAttrNameFunc
- type Summary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttrGaugeAdd ¶
func AttrGaugeAdd(metric AttrType)
func AttrGaugeInc ¶
func AttrGaugeInc(metric AttrType)
func AttrGaugeSet ¶
func AttrGaugeSet(metric AttrType)
func AttrGaugeSub ¶
func AttrGaugeSub(metric AttrType)
func DefaultParseAttrName ¶
func GetCounter ¶
func GetCounter(prefix, name string, constLabel prometheus.Labels, publicKeys, rfTags []string) prometheus.Counter
func GetCounterVec ¶
func GetCounterVec(prefix, name string, constLabel prometheus.Labels, publicKeys, rfTags []string) *prometheus.CounterVec
func GetGauge ¶
func GetGauge(prefix, name string, constLabel prometheus.Labels, publicKeys, rfTags []string) prometheus.Gauge
func GetGaugeVec ¶
func GetGaugeVec(prefix, name string, constLabel prometheus.Labels, publicKeys, rfTags []string) *prometheus.GaugeVec
func GetHistogram ¶
func GetHistogram(prefix, name string, constLabel prometheus.Labels, publicKeys, rfTags []string) prometheus.Histogram
func GetHistogramVec ¶
func GetHistogramVec(prefix, name string, constLabel prometheus.Labels, publicKeys, rfTags []string) *prometheus.HistogramVec
func GetSummary ¶
func GetSummary(prefix, name string, constLabel prometheus.Labels, publicKeys, rfTags []string) prometheus.Summary
func GetSummaryVec ¶
func GetSummaryVec(prefix, name string, constLabel prometheus.Labels, publicKeys, rfTags []string) *prometheus.SummaryVec
func InitMetrics ¶
func InitMetrics(prefix string, Metrics interface{}, labels prometheus.Labels, publicTags []string)
另一种实现方式,不过不能进行功能扩展,例如公共的labels需要额外处理 不过可以直接用prometheus的metric类型
func InitMetrics2 ¶
func InitMetrics2(prefix string, Metrics interface{}, labels prometheus.Labels, publicTags []string)
Types ¶
type Counter ¶
type Counter int
define Attr Types
func (Counter) GetMetricWith ¶
func (c Counter) GetMetricWith(labels prometheus.Labels) (prometheus.Counter, error)
func (Counter) GetMetricWithLabelValues ¶
func (c Counter) GetMetricWithLabelValues(lvs ...string) (prometheus.Counter, error)
func (Counter) With ¶
func (c Counter) With(labels prometheus.Labels) prometheus.Counter
func (Counter) WithLabelValues ¶
func (c Counter) WithLabelValues(lvs ...string) prometheus.Counter
type ParseAttrNameFunc ¶
var (
ParseAttrName ParseAttrNameFunc = nil
)
Click to show internal directories.
Click to hide internal directories.