Documentation ¶
Index ¶
- func RegisterCollector(collectors ...Collector) error
- func RegisterMetrics(allMetrics ...[]Metric) error
- type Collector
- type CollectorResult
- type Counter
- type CounterVec
- type Gauge
- type GaugeVec
- type Histogram
- type HistogramOpts
- type HistogramVec
- type Metric
- type MetricOpts
- type MetricType
- type RegistryFunc
- type Summary
- type SummaryOpts
- type SummaryVec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterCollector ¶
RegisterCollector registers the collector with the Prometheus registry.
func RegisterMetrics ¶
RegisterMetrics registers the metrics with the Prometheus registry.
Types ¶
type Collector ¶
type Collector struct { // Metrics is a list of metrics to be collected by the collector. Metrics []Metric // CollectCallback is a function that returns a list of CollectionResults. // The CollectionResults are used to populate the metrics in the collector. CollectCallback func() []CollectorResult }
Collector registers a prometheus.Collector with a set of metrics in the Prometheus registry. The metrics are collected by calling the CollectCallback function.
func (Collector) Collect ¶
func (c Collector) Collect(ch chan<- prometheus.Metric)
func (Collector) Describe ¶
func (c Collector) Describe(ch chan<- *prometheus.Desc)
type CollectorResult ¶
type Counter ¶
type Counter struct { prometheus.Counter // contains filtered or unexported fields }
func NewCounter ¶
func NewCounter(metricOpts MetricOpts) *Counter
NewCounter creates a new Counter. The Counter must be registered with the Prometheus registry through RegisterMetrics.
func (*Counter) GetOpts ¶
func (c *Counter) GetOpts() MetricOpts
func (*Counter) GetType ¶
func (c *Counter) GetType() MetricType
type CounterVec ¶
type CounterVec struct { prometheus.CounterVec // contains filtered or unexported fields }
func NewCounterVec ¶
func NewCounterVec(metricOpts MetricOpts, labels []string) *CounterVec
NewCounterVec creates a new CounterVec. The CounterVec must be registered with the Prometheus registry through RegisterMetrics.
func (*CounterVec) GetOpts ¶
func (c *CounterVec) GetOpts() MetricOpts
func (*CounterVec) GetType ¶
func (c *CounterVec) GetType() MetricType
type Gauge ¶
type Gauge struct { prometheus.Gauge // contains filtered or unexported fields }
func NewGauge ¶
func NewGauge(metricOpts MetricOpts) *Gauge
NewGauge creates a new Gauge. The Gauge must be registered with the Prometheus registry through RegisterMetrics.
func (*Gauge) GetOpts ¶
func (c *Gauge) GetOpts() MetricOpts
func (*Gauge) GetType ¶
func (c *Gauge) GetType() MetricType
type GaugeVec ¶
type GaugeVec struct { prometheus.GaugeVec // contains filtered or unexported fields }
func NewGaugeVec ¶
func NewGaugeVec(metricOpts MetricOpts, labels []string) *GaugeVec
NewGaugeVec creates a new GaugeVec. The GaugeVec must be registered with the Prometheus registry through RegisterMetrics.
func (*GaugeVec) GetOpts ¶
func (c *GaugeVec) GetOpts() MetricOpts
func (*GaugeVec) GetType ¶
func (c *GaugeVec) GetType() MetricType
type Histogram ¶
type Histogram struct { prometheus.Histogram // contains filtered or unexported fields }
func NewHistogram ¶
func NewHistogram(metricOpts MetricOpts, histogramOpts HistogramOpts) *Histogram
NewHistogram creates a new Histogram. The Histogram must be registered with the Prometheus registry through RegisterMetrics.
func (*Histogram) GetHistogramOpts ¶
func (c *Histogram) GetHistogramOpts() HistogramOpts
func (*Histogram) GetOpts ¶
func (c *Histogram) GetOpts() MetricOpts
func (*Histogram) GetType ¶
func (c *Histogram) GetType() MetricType
type HistogramOpts ¶
type HistogramVec ¶
type HistogramVec struct { prometheus.HistogramVec // contains filtered or unexported fields }
func NewHistogramVec ¶
func NewHistogramVec(metricOpts MetricOpts, histogramOpts HistogramOpts, labels []string) *HistogramVec
NewHistogramVec creates a new HistogramVec. The HistogramVec must be registered with the Prometheus registry through RegisterMetrics.
func (*HistogramVec) GetHistogramOpts ¶
func (c *HistogramVec) GetHistogramOpts() HistogramOpts
func (*HistogramVec) GetOpts ¶
func (c *HistogramVec) GetOpts() MetricOpts
func (*HistogramVec) GetType ¶
func (c *HistogramVec) GetType() MetricType
type Metric ¶
type Metric interface { GetOpts() MetricOpts GetType() MetricType // contains filtered or unexported methods }
func ListMetrics ¶
func ListMetrics() []Metric
ListMetrics returns a list of all registered metrics.
type MetricOpts ¶
type MetricType ¶
type MetricType string
const ( CounterType MetricType = "Counter" GaugeType MetricType = "Gauge" HistogramType MetricType = "Histogram" SummaryType MetricType = "Summary" CounterVecType MetricType = "CounterVec" GaugeVecType MetricType = "GaugeVec" HistogramVecType MetricType = "HistogramVec" SummaryVecType MetricType = "SummaryVec" )
type RegistryFunc ¶
type RegistryFunc func(c prometheus.Collector) error
var Register RegistryFunc = prometheus.Register
Register is the function used to register metrics and collectors by this package.
type Summary ¶
type Summary struct { prometheus.Summary // contains filtered or unexported fields }
func NewSummary ¶
func NewSummary(metricOpts MetricOpts, summaryOpts SummaryOpts) *Summary
NewSummary creates a new Summary. The Summary must be registered with the Prometheus registry through RegisterMetrics.
func (*Summary) GetOpts ¶
func (c *Summary) GetOpts() MetricOpts
func (*Summary) GetSummaryOpts ¶
func (c *Summary) GetSummaryOpts() SummaryOpts
func (*Summary) GetType ¶
func (c *Summary) GetType() MetricType
type SummaryOpts ¶
type SummaryVec ¶
type SummaryVec struct { prometheus.SummaryVec // contains filtered or unexported fields }
func NewSummaryVec ¶
func NewSummaryVec(metricOpts MetricOpts, summaryOpts SummaryOpts, labels []string) *SummaryVec
NewSummaryVec creates a new SummaryVec. The SummaryVec must be registered with the Prometheus registry through RegisterMetrics.
func (*SummaryVec) GetOpts ¶
func (c *SummaryVec) GetOpts() MetricOpts
func (*SummaryVec) GetSummaryOpts ¶
func (c *SummaryVec) GetSummaryOpts() SummaryOpts
func (*SummaryVec) GetType ¶
func (c *SummaryVec) GetType() MetricType