Documentation ¶
Index ¶
- Variables
- func Handler() http.Handler
- func NewCounterVec(name, help string, labels []string) *prometheus.CounterVec
- func NewGaugeVec(name, help string, labels []string) *prometheus.GaugeVec
- func NewHistogramVec(name, help string, labels []string, buckets []float64) *prometheus.HistogramVec
- func NewSummaryVec(name, help string, labels []string, objectives map[float64]float64) *prometheus.SummaryVec
- type Config
- type Metric
- func (m *Metric) Handler() http.Handler
- func (m *Metric) Name() string
- func (m *Metric) NewCounterVec(name, help string, labels []string) *prometheus.CounterVec
- func (m *Metric) NewGaugeVec(name, help string, labels []string) *prometheus.GaugeVec
- func (m *Metric) NewHistogramVec(name, help string, labels []string, buckets []float64) *prometheus.HistogramVec
- func (m *Metric) NewSummaryVec(name, help string, labels []string, objectives map[float64]float64) *prometheus.SummaryVec
- func (m *Metric) Serve(context.Context) error
- func (m *Metric) Shutdown(context.Context) error
- type OptionFunc
Constants ¶
This section is empty.
Variables ¶
var (
Default = DefaultConfig("").Build()
)
Functions ¶
func NewCounterVec ¶ added in v1.0.0
func NewCounterVec(name, help string, labels []string) *prometheus.CounterVec
NewCounterVec creates a new CounterVec based on the provided CounterOpts and partitioned by the given label names.
func NewGaugeVec ¶ added in v1.0.0
func NewGaugeVec(name, help string, labels []string) *prometheus.GaugeVec
NewGaugeVec creates a new GaugeVec based on the provided GaugeOpts and partitioned by the given label names.
func NewHistogramVec ¶ added in v1.0.0
func NewHistogramVec(name, help string, labels []string, buckets []float64) *prometheus.HistogramVec
NewHistogramVec creates a new HistogramVec based on the provided HistogramOpts and partitioned by the given label names.
func NewSummaryVec ¶ added in v1.0.0
func NewSummaryVec(name, help string, labels []string, objectives map[float64]float64) *prometheus.SummaryVec
NewSummaryVec creates a new SummaryVec based on the provided SummaryOpts and partitioned by the given label names.
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 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) *prometheus.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
func (m *Metric) NewGaugeVec(name, help string, labels []string) *prometheus.GaugeVec
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) *prometheus.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) *prometheus.SummaryVec
NewSummaryVec creates a new SummaryVec based on the provided SummaryOpts and partitioned by the given label names.