Documentation ¶
Index ¶
- Constants
- Variables
- func InitRegistry(conf *PrometheusConfig)
- type ConfigDecoder
- type Counter
- type CounterConfig
- type CounterOpts
- type CounterVec
- type CounterVecConfig
- type Gauge
- type GaugeConfig
- type GaugeOpts
- type GaugeVec
- type GaugeVecConfig
- type Histogram
- type HistogramConfig
- type HistogramOpts
- type HistogramOptsConfig
- type HistogramVec
- type HistogramVecConfig
- type Labels
- type LazyCounter
- type LazyCounterVec
- type LazyGauge
- type LazyGaugeVec
- type LazyHistogram
- type LazyHistogramVec
- type LazySummary
- type LazySummaryVec
- type Metric
- type Opts
- type OptsConfig
- type PrometheusConfig
- type Registry
- func (r *Registry) GetCounter(name string) Counter
- func (r *Registry) GetCounterVec(name string) *CounterVec
- func (r *Registry) GetGauge(name string) Gauge
- func (r *Registry) GetGaugeVec(name string) *GaugeVec
- func (r *Registry) GetHistogram(name string) Histogram
- func (r *Registry) GetHistogramVec(name string) *HistogramVec
- func (r *Registry) GetSummary(name string) Summary
- func (r *Registry) GetSummaryVec(name string) *SummaryVec
- type Summary
- type SummaryConfig
- type SummaryOpts
- type SummaryOptsConfig
- type SummaryVec
- type SummaryVecConfig
- type Timer
- type YamlNode
Constants ¶
View Source
const ( GaugeType = "gauge" GaugeVecType = "gauge_vector" CounterType = "counter" CounterVecType = "counter_vector" HistogramType = "histogram" HistogramVecType = "histogram_vector" SummaryType = "summary" SummaryVecType = "summary_vector" )
Variables ¶
View Source
var ( RemindOpts = Opts{ Namespace: "remind", } ErrorNotInit = errors.New("please init prometheus registry first") ErrorParseConfig = errors.New("prometheus parse config error ") ErrorInvalidConfig = errors.New("incorrect prometheus config for key ") ErrorMetricNotFound = errors.New("prometheus metric not found for key ") )
Functions ¶
func InitRegistry ¶
func InitRegistry(conf *PrometheusConfig)
Types ¶
type ConfigDecoder ¶
type ConfigDecoder interface {
Decode(v interface{}) (err error)
}
type Counter ¶
type Counter = prometheus.Counter
type CounterConfig ¶
type CounterConfig struct {
Opts OptsConfig `yaml:"opts"`
}
func (*CounterConfig) GetOpts ¶
func (c *CounterConfig) GetOpts() *OptsConfig
type CounterOpts ¶
type CounterOpts = prometheus.CounterOpts
type CounterVec ¶
type CounterVec = prometheus.CounterVec
type CounterVecConfig ¶
type CounterVecConfig struct { CounterConfig `yaml:",inline"` Labels []string `yaml:"labels"` }
func (*CounterVecConfig) GetLabels ¶
func (c *CounterVecConfig) GetLabels() []string
type Gauge ¶
type Gauge = prometheus.Gauge
type GaugeConfig ¶
type GaugeConfig struct {
Opts OptsConfig `yaml:"opts"`
}
func (*GaugeConfig) GetOpts ¶
func (c *GaugeConfig) GetOpts() *OptsConfig
type GaugeOpts ¶
type GaugeOpts = prometheus.GaugeOpts
type GaugeVec ¶
type GaugeVec = prometheus.GaugeVec
type GaugeVecConfig ¶
type GaugeVecConfig struct { GaugeConfig `yaml:",inline"` Labels []string `yaml:"labels"` }
func (*GaugeVecConfig) GetLabels ¶
func (c *GaugeVecConfig) GetLabels() []string
type Histogram ¶
type Histogram = prometheus.Histogram
type HistogramConfig ¶
type HistogramConfig struct {
Opts HistogramOptsConfig `yaml:"opts"`
}
func (*HistogramConfig) GetOpts ¶
func (c *HistogramConfig) GetOpts() *HistogramOptsConfig
type HistogramOpts ¶
type HistogramOpts = prometheus.HistogramOpts
type HistogramOptsConfig ¶
type HistogramOptsConfig struct { OptsConfig `yaml:",inline"` Buckets string `yaml:"buckets"` }
func (*HistogramOptsConfig) GetBuckets ¶
func (o *HistogramOptsConfig) GetBuckets() []float64
type HistogramVec ¶
type HistogramVec = prometheus.HistogramVec
type HistogramVecConfig ¶
type HistogramVecConfig struct { HistogramConfig `yaml:",inline"` Labels []string `yaml:"labels"` }
func (*HistogramVecConfig) GetLabels ¶
func (c *HistogramVecConfig) GetLabels() []string
type Labels ¶
type Labels = prometheus.Labels
type LazyCounter ¶
type LazyCounter struct { Value Counter // contains filtered or unexported fields }
func NewLazyCounter ¶
func NewLazyCounter(name string) *LazyCounter
func (*LazyCounter) Get ¶
func (c *LazyCounter) Get() (Counter, error)
type LazyCounterVec ¶
type LazyCounterVec struct { Value *CounterVec // contains filtered or unexported fields }
func NewLazyCounterVec ¶
func NewLazyCounterVec(name string) *LazyCounterVec
func (*LazyCounterVec) Get ¶
func (c *LazyCounterVec) Get() (*CounterVec, error)
type LazyGauge ¶
type LazyGauge struct { Value Gauge // contains filtered or unexported fields }
func NewLazyGauge ¶
type LazyGaugeVec ¶
type LazyGaugeVec struct { Value *GaugeVec // contains filtered or unexported fields }
func NewLazyGaugeVec ¶
func NewLazyGaugeVec(name string) *LazyGaugeVec
func (*LazyGaugeVec) Get ¶
func (c *LazyGaugeVec) Get() (*GaugeVec, error)
type LazyHistogram ¶
type LazyHistogram struct { Value Histogram // contains filtered or unexported fields }
func NewLazyHistogram ¶
func NewLazyHistogram(name string) *LazyHistogram
func (*LazyHistogram) Get ¶
func (c *LazyHistogram) Get() (Histogram, error)
type LazyHistogramVec ¶
type LazyHistogramVec struct { Value *HistogramVec // contains filtered or unexported fields }
func NewLazyHistogramVec ¶
func NewLazyHistogramVec(name string) *LazyHistogramVec
func (*LazyHistogramVec) Get ¶
func (c *LazyHistogramVec) Get() (*HistogramVec, error)
type LazySummary ¶
type LazySummary struct { Value Histogram // contains filtered or unexported fields }
func NewLazySummary ¶
func NewLazySummary(name string) *LazySummary
func (*LazySummary) Get ¶
func (c *LazySummary) Get() (Summary, error)
type LazySummaryVec ¶
type LazySummaryVec struct { Value *SummaryVec // contains filtered or unexported fields }
func NewLazySummaryVec ¶
func NewLazySummaryVec(name string) *LazySummaryVec
func (*LazySummaryVec) Get ¶
func (c *LazySummaryVec) Get() (*SummaryVec, error)
type Metric ¶
type Opts ¶
type Opts = prometheus.Opts
type OptsConfig ¶
type OptsConfig struct { Namespace string `yaml:"namespace"` Subsystem string `yaml:"subsystem"` Name string `yaml:"name"` Help string `yaml:"help"` }
func (*OptsConfig) GetHelp ¶
func (o *OptsConfig) GetHelp() string
func (*OptsConfig) GetName ¶
func (o *OptsConfig) GetName() string
func (*OptsConfig) GetNamespace ¶
func (o *OptsConfig) GetNamespace() string
func (*OptsConfig) GetSubsystem ¶
func (o *OptsConfig) GetSubsystem() string
type PrometheusConfig ¶
type PrometheusConfig struct { Path string `yaml:"path"` Listen string `yaml:"listen"` Metrics []Metric `yaml:"metrics"` }
func (*PrometheusConfig) GetListen ¶
func (c *PrometheusConfig) GetListen() string
func (*PrometheusConfig) GetPath ¶
func (c *PrometheusConfig) GetPath() string
type Registry ¶
func GetRegistry ¶
func GetRegistry() *Registry
func NewRegistry ¶
func NewRegistry(conf *PrometheusConfig) *Registry
func (*Registry) GetCounter ¶
func (*Registry) GetCounterVec ¶
func (r *Registry) GetCounterVec(name string) *CounterVec
func (*Registry) GetGaugeVec ¶
func (*Registry) GetHistogram ¶
func (*Registry) GetHistogramVec ¶
func (r *Registry) GetHistogramVec(name string) *HistogramVec
func (*Registry) GetSummary ¶
func (*Registry) GetSummaryVec ¶
func (r *Registry) GetSummaryVec(name string) *SummaryVec
type Summary ¶
type Summary = prometheus.Summary
type SummaryConfig ¶
type SummaryConfig struct {
Opts SummaryOptsConfig `yaml:"opts"`
}
func (*SummaryConfig) GetOpts ¶
func (c *SummaryConfig) GetOpts() *SummaryOptsConfig
type SummaryOpts ¶
type SummaryOpts = prometheus.SummaryOpts
type SummaryOptsConfig ¶
type SummaryOptsConfig struct { OptsConfig `yaml:",inline"` Objectives string `yaml:"objectives"` MaxAge int `yaml:"max_age"` AgeBuckets uint32 `yaml:"age_buckets"` BufCap uint32 `yaml:"buf_cap"` }
func (*SummaryOptsConfig) GetAgeBuckets ¶
func (o *SummaryOptsConfig) GetAgeBuckets() uint32
func (*SummaryOptsConfig) GetBufCap ¶
func (o *SummaryOptsConfig) GetBufCap() uint32
func (*SummaryOptsConfig) GetMaxAge ¶
func (o *SummaryOptsConfig) GetMaxAge() time.Duration
func (*SummaryOptsConfig) GetObjectives ¶
func (o *SummaryOptsConfig) GetObjectives() map[float64]float64
type SummaryVec ¶
type SummaryVec = prometheus.SummaryVec
type SummaryVecConfig ¶
type SummaryVecConfig struct { SummaryConfig `yaml:",inline"` Labels []string `yaml:"labels"` }
func (*SummaryVecConfig) GetLabels ¶
func (c *SummaryVecConfig) GetLabels() []string
type Timer ¶
type Timer = prometheus.Timer
Click to show internal directories.
Click to hide internal directories.