package prometheus
import "github.com/google/trillian/monitoring/prometheus"
Package prometheus provides a Prometheus-based implementation of the MetricFactory abstraction.
Index ¶
- type Counter
- func (m *Counter) Add(val float64, labelVals ...string)
- func (m *Counter) Inc(labelVals ...string)
- func (m *Counter) Value(labelVals ...string) float64
- type Gauge
- func (m *Gauge) Add(val float64, labelVals ...string)
- func (m *Gauge) Dec(labelVals ...string)
- func (m *Gauge) Inc(labelVals ...string)
- func (m *Gauge) Set(val float64, labelVals ...string)
- func (m *Gauge) Value(labelVals ...string) float64
- type Histogram
- func (m *Histogram) Info(labelVals ...string) (uint64, float64)
- func (m *Histogram) Observe(val float64, labelVals ...string)
- type MetricFactory
- func (pmf MetricFactory) NewCounter(name, help string, labelNames ...string) monitoring.Counter
- func (pmf MetricFactory) NewGauge(name, help string, labelNames ...string) monitoring.Gauge
- func (pmf MetricFactory) NewHistogram(name, help string, labelNames ...string) monitoring.Histogram
- func (pmf MetricFactory) NewHistogramWithBuckets(name, help string, buckets []float64, labelNames ...string) monitoring.Histogram
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter is a wrapper around a Prometheus Counter or CounterVec object.
func (*Counter) Add ¶
Add adds the given amount to a counter.
func (*Counter) Inc ¶
Inc adds 1 to a counter.
func (*Counter) Value ¶
Value returns the current amount of a counter.
type Gauge ¶
type Gauge struct {
// contains filtered or unexported fields
}
Gauge is a wrapper around a Prometheus Gauge or GaugeVec object.
func (*Gauge) Add ¶
Add adds given value to a gauge.
func (*Gauge) Dec ¶
Dec subtracts 1 from a gauge.
func (*Gauge) Inc ¶
Inc adds 1 to a gauge.
func (*Gauge) Set ¶
Set sets the value of a gauge.
func (*Gauge) Value ¶
Value returns the current amount of a gauge.
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
Histogram is a wrapper around a Prometheus Histogram or HistogramVec object.
func (*Histogram) Info ¶
Info returns the count and sum of observations for the histogram.
func (*Histogram) Observe ¶
Observe adds a single observation to the histogram.
type MetricFactory ¶
type MetricFactory struct { // Prefix is an identifier that will be used before local metric names that // are reported. It is strongly recommended that this ends with a valid // separator (e.g. "_") in order to improve readability; no separator is // added by this library. Prefix string }
MetricFactory allows the creation of Prometheus-based metrics.
func (MetricFactory) NewCounter ¶
func (pmf MetricFactory) NewCounter(name, help string, labelNames ...string) monitoring.Counter
NewCounter creates a new Counter object backed by Prometheus.
func (MetricFactory) NewGauge ¶
func (pmf MetricFactory) NewGauge(name, help string, labelNames ...string) monitoring.Gauge
NewGauge creates a new Gauge object backed by Prometheus.
func (MetricFactory) NewHistogram ¶
func (pmf MetricFactory) NewHistogram(name, help string, labelNames ...string) monitoring.Histogram
NewHistogram creates a new Histogram object backed by Prometheus with the supplied buckets.
func (MetricFactory) NewHistogramWithBuckets ¶
func (pmf MetricFactory) NewHistogramWithBuckets(name, help string, buckets []float64, labelNames ...string) monitoring.Histogram
NewHistogramWithBuckets creates a new Histogram object backed by Prometheus and using the supplied bucketing intervals. Note: the number of buckets should be kept within reasonable bounds.
Source Files ¶
- Version
- v1.7.1 (latest)
- Published
- Jan 9, 2025
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 5 days ago –
Tools for package owners.