Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter is a Metric that represents a single numerical value that only ever goes up. That implies that it cannot be used to count items whose number can also go down, e.g. the number of currently running goroutines. Those "counters" are represented by Gauges.
func NewCounter ¶
NewCounter creates a new Counter based on the provided CounterOpts.
type CounterVec ¶ added in v1.0.5
type CounterVec struct {
// contains filtered or unexported fields
}
CounterVec is a Collector that bundles a set of Counters that all share the same Desc, but have different values for their variable labels. This is used if you want to count the same thing partitioned by various dimensions (e.g. number of HTTP requests, partitioned by response code and method). Create instances with NewCounterVec.
func NewCounterVec ¶ added in v1.0.5
func NewCounterVec(name, desc string, labelKeys []string) *CounterVec
NewCounterVec creates a new CounterVec based on the provided CounterOpts and partitioned by the given label names.
func (*CounterVec) Add ¶ added in v1.0.5
func (c *CounterVec) Add(labels Labels, val float64)
Add counter metrics value
func (*CounterVec) Delete ¶ added in v1.0.7
func (c *CounterVec) Delete(labels Labels) bool
Delete deletes the metric where the variable labels are the same as those passed in as labels. It returns true if a metric was deleted.
func (*CounterVec) Reset ¶ added in v1.0.7
func (c *CounterVec) Reset()
Reset deletes all metrics in this vector
type Gauge ¶
type Gauge struct {
// contains filtered or unexported fields
}
Gauge is a Metric that represents a single numerical value that can arbitrarily go up and down.
A Gauge is typically used for measured values like temperatures or current memory usage, but also "counts" that can go up and down, like the number of running goroutines.
To create Gauge instances, use NewGauge.
type GaugeVec ¶ added in v1.0.5
type GaugeVec struct {
// contains filtered or unexported fields
}
GaugeVec is a Collector that bundles a set of Gauges that all share the same Desc, but have different values for their variable labels. This is used if you want to count the same thing partitioned by various dimensions (e.g. number of operations queued, partitioned by user and operation type). Create instances with NewGaugeVec.
func NewGaugeVec ¶ added in v1.0.5
NewGaugeVec creates a new GaugeVec based on the provided name, desc and the given label names.
func (*GaugeVec) Delete ¶ added in v1.0.7
Delete deletes the metric where the variable labels are the same as those passed in as labels. It returns true if a metric was deleted.
func (*GaugeVec) Reset ¶ added in v1.0.7
func (g *GaugeVec) Reset()
Reset deletes all metrics in this vector
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
A Histogram counts individual observations from an event or sample stream in configurable buckets. Similar to a summary, it also provides a sum of observations and an observation count.
On the Prometheus server, quantiles can be calculated from a Histogram using the histogram_quantile function in the query language.
Note that Histograms, in contrast to Summaries, can be aggregated with the Prometheus query language (see the documentation for detailed procedures). However, Histograms require the user to pre-define suitable buckets, and they are in general less accurate. The Observe method of a Histogram has a very low performance overhead in comparison with the Observe method of a Summary.
func NewHistogram ¶
NewHistogram creates a new Histogram based on the provided name, desc, buckets. It panics if the buckets in HistogramOpts are not in strictly increasing order.
type HistogramVec ¶ added in v1.0.5
type HistogramVec struct {
// contains filtered or unexported fields
}
HistogramVec is a Collector that bundles a set of Histograms that all share the same Desc, but have different values for their variable labels. This is used if you want to count the same thing partitioned by various dimensions (e.g. HTTP request latencies, partitioned by status code and method). Create instances with NewHistogramVec.
func NewHistogramVec ¶ added in v1.0.5
func NewHistogramVec(name, desc string, buckets []float64, labelKeys []string) *HistogramVec
NewHistogramVec creates a new HistogramVec based on the provided name, desc and given label names.
func (*HistogramVec) Delete ¶ added in v1.0.7
func (h *HistogramVec) Delete(labels Labels) bool
Delete deletes the metric where the variable labels are the same as those passed in as labels. It returns true if a metric was deleted.
func (*HistogramVec) Observe ¶ added in v1.0.5
func (h *HistogramVec) Observe(label Labels, val float64)
Observe metrics value
func (*HistogramVec) Reset ¶ added in v1.0.7
func (h *HistogramVec) Reset()
Reset deletes all metrics in this vector
type Summary ¶
type Summary struct {
// contains filtered or unexported fields
}
A Summary captures individual observations from an event or sample stream and summarizes them in a manner similar to traditional summary statistics: 1. sum of observations, 2. observation count, 3. rank estimations.
A typical use-case is the observation of request latencies. By default, a Summary provides the median, the 90th and the 99th percentile of the latency as rank estimations. However, the default behavior will change in the upcoming v0.10 of the library. There will be no rank estimations at all by default. For a sane transition, it is recommended to set the desired rank estimations explicitly.
func NewSummary ¶
NewSummary creates a new Summary based on the provided name, desc
type SummaryVec ¶ added in v1.0.5
type SummaryVec struct {
// contains filtered or unexported fields
}
SummaryVec is a Collector that bundles a set of Summaries that all share the same Desc, but have different values for their variable labels. This is used if you want to count the same thing partitioned by various dimensions (e.g. HTTP request latencies, partitioned by status code and method). Create instances with NewSummaryVec.
func NewSummaryVec ¶ added in v1.0.5
func NewSummaryVec(name, desc string, labelKeys []string) *SummaryVec
NewSummaryVec creates a new SummaryVec based on the provided name, desc and partitioned by the given label names.
Due to the way a Summary is represented in the Prometheus text format and how it is handled by the Prometheus server internally, “quantile” is an illegal label name. NewSummaryVec will panic if this label name is used.
func (*SummaryVec) Delete ¶ added in v1.0.7
func (s *SummaryVec) Delete(labels Labels) bool
Delete deletes the metric where the variable labels are the same as those passed in as labels. It returns true if a metric was deleted.
func (*SummaryVec) Observe ¶ added in v1.0.5
func (s *SummaryVec) Observe(label Labels, val float64)
Observe metrics
func (*SummaryVec) Reset ¶ added in v1.0.7
func (s *SummaryVec) Reset()
Reset deletes all metrics in this vector