forked from mirror/client_golang
Remove obsolete references to `Untyped` from doc comments
Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
parent
913f67ef06
commit
87f9434351
|
@ -84,25 +84,21 @@
|
||||||
// of those four metric types can be found in the Prometheus docs:
|
// of those four metric types can be found in the Prometheus docs:
|
||||||
// https://prometheus.io/docs/concepts/metric_types/
|
// https://prometheus.io/docs/concepts/metric_types/
|
||||||
//
|
//
|
||||||
// A fifth "type" of metric is Untyped. It behaves like a Gauge, but signals the
|
// In addition to the fundamental metric types Gauge, Counter, Summary, and
|
||||||
// Prometheus server not to assume anything about its type.
|
// Histogram, a very important part of the Prometheus data model is the
|
||||||
//
|
// partitioning of samples along dimensions called labels, which results in
|
||||||
// In addition to the fundamental metric types Gauge, Counter, Summary,
|
|
||||||
// Histogram, and Untyped, a very important part of the Prometheus data model is
|
|
||||||
// the partitioning of samples along dimensions called labels, which results in
|
|
||||||
// metric vectors. The fundamental types are GaugeVec, CounterVec, SummaryVec,
|
// metric vectors. The fundamental types are GaugeVec, CounterVec, SummaryVec,
|
||||||
// HistogramVec, and UntypedVec.
|
// and HistogramVec.
|
||||||
//
|
//
|
||||||
// While only the fundamental metric types implement the Metric interface, both
|
// While only the fundamental metric types implement the Metric interface, both
|
||||||
// the metrics and their vector versions implement the Collector interface. A
|
// the metrics and their vector versions implement the Collector interface. A
|
||||||
// Collector manages the collection of a number of Metrics, but for convenience,
|
// Collector manages the collection of a number of Metrics, but for convenience,
|
||||||
// a Metric can also “collect itself”. Note that Gauge, Counter, Summary,
|
// a Metric can also “collect itself”. Note that Gauge, Counter, Summary, and
|
||||||
// Histogram, and Untyped are interfaces themselves while GaugeVec, CounterVec,
|
// Histogram are interfaces themselves while GaugeVec, CounterVec, SummaryVec,
|
||||||
// SummaryVec, HistogramVec, and UntypedVec are not.
|
// and HistogramVec are not.
|
||||||
//
|
//
|
||||||
// To create instances of Metrics and their vector versions, you need a suitable
|
// To create instances of Metrics and their vector versions, you need a suitable
|
||||||
// …Opts struct, i.e. GaugeOpts, CounterOpts, SummaryOpts, HistogramOpts, or
|
// …Opts struct, i.e. GaugeOpts, CounterOpts, SummaryOpts, or HistogramOpts.
|
||||||
// UntypedOpts.
|
|
||||||
//
|
//
|
||||||
// Custom Collectors and constant Metrics
|
// Custom Collectors and constant Metrics
|
||||||
//
|
//
|
||||||
|
@ -118,13 +114,16 @@
|
||||||
// existing numbers into Prometheus Metrics during collection. An own
|
// existing numbers into Prometheus Metrics during collection. An own
|
||||||
// implementation of the Collector interface is perfect for that. You can create
|
// implementation of the Collector interface is perfect for that. You can create
|
||||||
// Metric instances “on the fly” using NewConstMetric, NewConstHistogram, and
|
// Metric instances “on the fly” using NewConstMetric, NewConstHistogram, and
|
||||||
// NewConstSummary (and their respective Must… versions). That will happen in
|
// NewConstSummary (and their respective Must… versions). NewConstMetric is used
|
||||||
// the Collect method. The Describe method has to return separate Desc
|
// for all metric types with just a float64 as their value: Counter, Gauge, and
|
||||||
// instances, representative of the “throw-away” metrics to be created later.
|
// a special “type” called Untyped. Use the latter if you are not sure if the
|
||||||
// NewDesc comes in handy to create those Desc instances. Alternatively, you
|
// mirrored metric is a Counter or a Gauge. Creation of the Metric instance
|
||||||
// could return no Desc at all, which will mark the Collector “unchecked”. No
|
// happens in the Collect method. The Describe method has to return separate
|
||||||
// checks are performed at registration time, but metric consistency will still
|
// Desc instances, representative of the “throw-away” metrics to be created
|
||||||
// be ensured at scrape time, i.e. any inconsistencies will lead to scrape
|
// later. NewDesc comes in handy to create those Desc instances. Alternatively,
|
||||||
|
// you could return no Desc at all, which will mark the Collector “unchecked”.
|
||||||
|
// No checks are performed at registration time, but metric consistency will
|
||||||
|
// still be ensured at scrape time, i.e. any inconsistencies will lead to scrape
|
||||||
// errors. Thus, with unchecked Collectors, the responsibility to not collect
|
// errors. Thus, with unchecked Collectors, the responsibility to not collect
|
||||||
// metrics that lead to inconsistencies in the total scrape result lies with the
|
// metrics that lead to inconsistencies in the total scrape result lies with the
|
||||||
// implementer of the Collector. While this is not a desirable state, it is
|
// implementer of the Collector. While this is not a desirable state, it is
|
||||||
|
|
|
@ -28,7 +28,8 @@ import (
|
||||||
// ValueType is an enumeration of metric types that represent a simple value.
|
// ValueType is an enumeration of metric types that represent a simple value.
|
||||||
type ValueType int
|
type ValueType int
|
||||||
|
|
||||||
// Possible values for the ValueType enum.
|
// Possible values for the ValueType enum. Use UntypedValue to mark a metric
|
||||||
|
// with an unknown type.
|
||||||
const (
|
const (
|
||||||
_ ValueType = iota
|
_ ValueType = iota
|
||||||
CounterValue
|
CounterValue
|
||||||
|
|
Loading…
Reference in New Issue