Convert remaining collectors to use ConstMetrics
This commit is contained in:
parent
c53bc168fe
commit
8e50b80d12
17 changed files with 455 additions and 614 deletions
|
|
@ -32,3 +32,12 @@ type Collector interface {
|
|||
// Get new metrics and expose them via prometheus registry.
|
||||
Update(ch chan<- prometheus.Metric) (err error)
|
||||
}
|
||||
|
||||
type typedDesc struct {
|
||||
desc *prometheus.Desc
|
||||
valueType prometheus.ValueType
|
||||
}
|
||||
|
||||
func (d *typedDesc) mustNewConstMetric(value float64, labels ...string) prometheus.Metric {
|
||||
return prometheus.MustNewConstMetric(d.desc, d.valueType, value, labels...)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue