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 ¶ added in v1.0.0
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 DefaultConfig ¶ added in v1.0.0
DefaultConfig is default config.
func StdConfig ¶ added in v1.0.0
func StdConfig(key string, optionFunc ...OptionFunc) *Config
StdConfig load config from config center.
type CounterVec ¶ added in v1.0.0
type CounterVec = prometheus.CounterVec
func NewCounterVec ¶ added in v1.0.0
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 ¶ added in v1.0.0
type GaugeVec = prometheus.GaugeVec
func NewGaugeVec ¶ added in v1.0.0
NewGaugeVec creates a new GaugeVec based on the provided GaugeOpts and partitioned by the given label names.
type HistogramVec ¶ added in v1.0.0
type HistogramVec = prometheus.HistogramVec
func NewHistogramVec ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
NewGaugeVec creates a new GaugeVec based on the provided GaugeOpts and partitioned by the given label names.
func (*Metric) NewHistogramVec ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
type SummaryVec = prometheus.SummaryVec
func NewSummaryVec ¶ added in v1.0.0
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.