Documentation
¶
Overview ¶
Package promcap wraps Prometheus *Vec metrics with a cardinality cap, collapsing label combinations beyond a configured limit into an overflow series.
The label value "__overflow__" is reserved: any real label value equal to it will silently merge into the overflow bucket.
Capped: WithLabelValues, With, GetMetricWith, GetMetricWithLabelValues, Reset.
Not yet wrapped: CurryWith, Delete, DeleteLabelValues. Code relying on these is not yet a drop-in replacement.
Index ¶
- type Cap
- func (c *Cap) NewCounterVec(opts prometheus.CounterOpts, labels []string, capOpts CapOpts) *CappedCounterVec
- func (c *Cap) NewGaugeVec(opts prometheus.GaugeOpts, labels []string, capOpts CapOpts) *CappedGaugeVec
- func (c *Cap) NewHistogramVec(opts prometheus.HistogramOpts, labels []string, capOpts CapOpts) *CappedHistogramVec
- func (c *Cap) NewSummaryVec(opts prometheus.SummaryOpts, labels []string, capOpts CapOpts) *CappedSummaryVec
- type CapOpts
- type CappedCounterVec
- func (ccv *CappedCounterVec) Collect(ch chan<- prometheus.Metric)
- func (ccv *CappedCounterVec) Describe(ch chan<- *prometheus.Desc)
- func (ccv *CappedCounterVec) GetMetricWith(labels prometheus.Labels) (prometheus.Counter, error)
- func (ccv *CappedCounterVec) GetMetricWithLabelValues(lvs ...string) (prometheus.Counter, error)
- func (ccv *CappedCounterVec) Reset()
- func (ccv *CappedCounterVec) With(labels prometheus.Labels) prometheus.Counter
- func (ccv *CappedCounterVec) WithLabelValues(lvs ...string) prometheus.Counter
- type CappedGaugeVec
- func (cgv *CappedGaugeVec) Collect(ch chan<- prometheus.Metric)
- func (cgv *CappedGaugeVec) Describe(ch chan<- *prometheus.Desc)
- func (cgv *CappedGaugeVec) GetMetricWith(labels prometheus.Labels) (prometheus.Gauge, error)
- func (cgv *CappedGaugeVec) GetMetricWithLabelValues(lvs ...string) (prometheus.Gauge, error)
- func (cgv *CappedGaugeVec) Reset()
- func (cgv *CappedGaugeVec) With(labels prometheus.Labels) prometheus.Gauge
- func (cgv *CappedGaugeVec) WithLabelValues(lvs ...string) prometheus.Gauge
- type CappedHistogramVec
- func (hgv *CappedHistogramVec) Collect(ch chan<- prometheus.Metric)
- func (hgv *CappedHistogramVec) Describe(ch chan<- *prometheus.Desc)
- func (hgv *CappedHistogramVec) GetMetricWith(labels prometheus.Labels) (prometheus.Observer, error)
- func (hgv *CappedHistogramVec) GetMetricWithLabelValues(lvs ...string) (prometheus.Observer, error)
- func (hgv *CappedHistogramVec) Reset()
- func (hgv *CappedHistogramVec) With(labels prometheus.Labels) prometheus.Observer
- func (hgv *CappedHistogramVec) WithLabelValues(lvs ...string) prometheus.Observer
- type CappedSummaryVec
- func (sumv *CappedSummaryVec) Collect(ch chan<- prometheus.Metric)
- func (sumv *CappedSummaryVec) Describe(ch chan<- *prometheus.Desc)
- func (sumv *CappedSummaryVec) GetMetricWith(labels prometheus.Labels) (prometheus.Observer, error)
- func (sumv *CappedSummaryVec) GetMetricWithLabelValues(lvs ...string) (prometheus.Observer, error)
- func (sumv *CappedSummaryVec) Reset()
- func (sumv *CappedSummaryVec) With(labels prometheus.Labels) prometheus.Observer
- func (sumv *CappedSummaryVec) WithLabelValues(lvs ...string) prometheus.Observer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cap ¶
type Cap struct {
// contains filtered or unexported fields
}
func Wrap ¶
func Wrap(reg prometheus.Registerer) *Cap
func (*Cap) NewCounterVec ¶
func (c *Cap) NewCounterVec(opts prometheus.CounterOpts, labels []string, capOpts CapOpts) *CappedCounterVec
func (*Cap) NewGaugeVec ¶
func (c *Cap) NewGaugeVec(opts prometheus.GaugeOpts, labels []string, capOpts CapOpts) *CappedGaugeVec
func (*Cap) NewHistogramVec ¶
func (c *Cap) NewHistogramVec(opts prometheus.HistogramOpts, labels []string, capOpts CapOpts) *CappedHistogramVec
func (*Cap) NewSummaryVec ¶
func (c *Cap) NewSummaryVec(opts prometheus.SummaryOpts, labels []string, capOpts CapOpts) *CappedSummaryVec
type CapOpts ¶
type CapOpts struct {
MaxSeries int
// Allow restricts a label to the listed values; non-listed values overflow immediately.
// Allowed values still consume the MaxSeries budget.
Allow map[string][]string
// Evict, when true, evicts the least-recently-used series to admit a new one
// once MaxSeries is reached, instead of collapsing into the overflow series.
// Evicted series are deleted from the metric; for counters this discards their
// accumulated value.
Evict bool
}
type CappedCounterVec ¶
type CappedCounterVec struct {
// contains filtered or unexported fields
}
func (*CappedCounterVec) Collect ¶
func (ccv *CappedCounterVec) Collect(ch chan<- prometheus.Metric)
func (*CappedCounterVec) Describe ¶
func (ccv *CappedCounterVec) Describe(ch chan<- *prometheus.Desc)
func (*CappedCounterVec) GetMetricWith ¶
func (ccv *CappedCounterVec) GetMetricWith(labels prometheus.Labels) (prometheus.Counter, error)
func (*CappedCounterVec) GetMetricWithLabelValues ¶
func (ccv *CappedCounterVec) GetMetricWithLabelValues(lvs ...string) (prometheus.Counter, error)
func (*CappedCounterVec) Reset ¶
func (ccv *CappedCounterVec) Reset()
func (*CappedCounterVec) With ¶
func (ccv *CappedCounterVec) With(labels prometheus.Labels) prometheus.Counter
func (*CappedCounterVec) WithLabelValues ¶
func (ccv *CappedCounterVec) WithLabelValues(lvs ...string) prometheus.Counter
type CappedGaugeVec ¶
type CappedGaugeVec struct {
// contains filtered or unexported fields
}
func (*CappedGaugeVec) Collect ¶
func (cgv *CappedGaugeVec) Collect(ch chan<- prometheus.Metric)
func (*CappedGaugeVec) Describe ¶
func (cgv *CappedGaugeVec) Describe(ch chan<- *prometheus.Desc)
func (*CappedGaugeVec) GetMetricWith ¶
func (cgv *CappedGaugeVec) GetMetricWith(labels prometheus.Labels) (prometheus.Gauge, error)
func (*CappedGaugeVec) GetMetricWithLabelValues ¶
func (cgv *CappedGaugeVec) GetMetricWithLabelValues(lvs ...string) (prometheus.Gauge, error)
func (*CappedGaugeVec) Reset ¶
func (cgv *CappedGaugeVec) Reset()
func (*CappedGaugeVec) With ¶
func (cgv *CappedGaugeVec) With(labels prometheus.Labels) prometheus.Gauge
func (*CappedGaugeVec) WithLabelValues ¶
func (cgv *CappedGaugeVec) WithLabelValues(lvs ...string) prometheus.Gauge
type CappedHistogramVec ¶
type CappedHistogramVec struct {
// contains filtered or unexported fields
}
func (*CappedHistogramVec) Collect ¶
func (hgv *CappedHistogramVec) Collect(ch chan<- prometheus.Metric)
func (*CappedHistogramVec) Describe ¶
func (hgv *CappedHistogramVec) Describe(ch chan<- *prometheus.Desc)
func (*CappedHistogramVec) GetMetricWith ¶
func (hgv *CappedHistogramVec) GetMetricWith(labels prometheus.Labels) (prometheus.Observer, error)
func (*CappedHistogramVec) GetMetricWithLabelValues ¶
func (hgv *CappedHistogramVec) GetMetricWithLabelValues(lvs ...string) (prometheus.Observer, error)
func (*CappedHistogramVec) Reset ¶
func (hgv *CappedHistogramVec) Reset()
func (*CappedHistogramVec) With ¶
func (hgv *CappedHistogramVec) With(labels prometheus.Labels) prometheus.Observer
func (*CappedHistogramVec) WithLabelValues ¶
func (hgv *CappedHistogramVec) WithLabelValues(lvs ...string) prometheus.Observer
type CappedSummaryVec ¶
type CappedSummaryVec struct {
// contains filtered or unexported fields
}
func (*CappedSummaryVec) Collect ¶
func (sumv *CappedSummaryVec) Collect(ch chan<- prometheus.Metric)
func (*CappedSummaryVec) Describe ¶
func (sumv *CappedSummaryVec) Describe(ch chan<- *prometheus.Desc)
func (*CappedSummaryVec) GetMetricWith ¶
func (sumv *CappedSummaryVec) GetMetricWith(labels prometheus.Labels) (prometheus.Observer, error)
func (*CappedSummaryVec) GetMetricWithLabelValues ¶
func (sumv *CappedSummaryVec) GetMetricWithLabelValues(lvs ...string) (prometheus.Observer, error)
func (*CappedSummaryVec) Reset ¶
func (sumv *CappedSummaryVec) Reset()
func (*CappedSummaryVec) With ¶
func (sumv *CappedSummaryVec) With(labels prometheus.Labels) prometheus.Observer
func (*CappedSummaryVec) WithLabelValues ¶
func (sumv *CappedSummaryVec) WithLabelValues(lvs ...string) prometheus.Observer
Click to show internal directories.
Click to hide internal directories.