Documentation ¶
Index ¶
- Variables
- func Handler() http.Handler
- type Config
- type CounterVec
- type GaugeVec
- type HistogramVec
- type Metric
- func (m *Metric) Handler() http.Handler
- func (m *Metric) Name() string
- func (m *Metric) NewCounterVec(name, help string, labels []string) *CounterVec
- func (m *Metric) NewGaugeVec(name, help string, labels []string) *GaugeVec
- func (m *Metric) NewHistogramVec(name, help string, labels []string, buckets []float64) *HistogramVec
- func (m *Metric) NewSummaryVec(name, help string, labels []string, objectives map[float64]float64) *SummaryVec
- func (m *Metric) Serve(context.Context) error
- func (m *Metric) Shutdown(context.Context) error
- type OptionFunc
- type SummaryVec
Constants ¶
This section is empty.
Variables ¶
var (
Default = StdConfig("").Build()
)
Functions ¶
Types ¶
type Config ¶
type Config struct { Namespace string `config:"namespace"` Subsystem string `config:"subsystem"` PushEnabled bool `config:"pushEnabled"` PushTargetURL string `config:"pushTargetURL"` PushInterval time.Duration `config:"pushInterval"` }
func StdConfig ¶
func StdConfig(key string, optionFunc ...OptionFunc) *Config
StdConfig load config from config center.
type CounterVec ¶
type CounterVec = prometheus.CounterVec
func NewCounterVec ¶
func NewCounterVec(name, help string, labels []string) *CounterVec
NewCounterVec creates a new CounterVec based on the provided CounterOpts and partitioned by the given label names.
type GaugeVec ¶
type GaugeVec = prometheus.GaugeVec
func NewGaugeVec ¶
NewGaugeVec creates a new GaugeVec based on the provided GaugeOpts and partitioned by the given label names.
type HistogramVec ¶
type HistogramVec = prometheus.HistogramVec
func NewHistogramVec ¶
func NewHistogramVec(name, help string, labels []string, buckets []float64) *HistogramVec
NewHistogramVec creates a new HistogramVec based on the provided HistogramOpts and partitioned by the given label names.
type Metric ¶
type Metric struct {
// contains filtered or unexported fields
}
Metric config
func (*Metric) NewCounterVec ¶
func (m *Metric) NewCounterVec(name, help string, labels []string) *CounterVec
NewCounterVec creates a new CounterVec based on the provided CounterOpts and partitioned by the given label names.
func (*Metric) NewGaugeVec ¶
NewGaugeVec creates a new GaugeVec based on the provided GaugeOpts and partitioned by the given label names.
func (*Metric) NewHistogramVec ¶
func (m *Metric) NewHistogramVec(name, help string, labels []string, buckets []float64) *HistogramVec
NewHistogramVec creates a new HistogramVec based on the provided HistogramOpts and partitioned by the given label names.
func (*Metric) NewSummaryVec ¶
func (m *Metric) NewSummaryVec(name, help string, labels []string, objectives map[float64]float64) *SummaryVec
NewSummaryVec creates a new SummaryVec based on the provided SummaryOpts and partitioned by the given label names.
type SummaryVec ¶
type SummaryVec = prometheus.SummaryVec
func NewSummaryVec ¶
func NewSummaryVec(name, help string, labels []string, objectives map[float64]float64) *SummaryVec
NewSummaryVec creates a new SummaryVec based on the provided SummaryOpts and partitioned by the given label names.