mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2024-11-26 17:21:01 +00:00
rename labelsNames to labelNames
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
This commit is contained in:
parent
e1a3a5fc32
commit
57495db281
1 changed files with 5 additions and 5 deletions
10
exporter.go
10
exporter.go
|
@ -50,7 +50,7 @@ var (
|
||||||
intBuf = make([]byte, 8)
|
intBuf = make([]byte, 8)
|
||||||
)
|
)
|
||||||
|
|
||||||
func labelsNames(labels prometheus.Labels) []string {
|
func labelNames(labels prometheus.Labels) []string {
|
||||||
names := make([]string, 0, len(labels))
|
names := make([]string, 0, len(labels))
|
||||||
for labelName := range labels {
|
for labelName := range labels {
|
||||||
names = append(names, labelName)
|
names = append(names, labelName)
|
||||||
|
@ -91,7 +91,7 @@ func (c *CounterContainer) Get(metricName string, labels prometheus.Labels, help
|
||||||
counterVec = prometheus.NewCounterVec(prometheus.CounterOpts{
|
counterVec = prometheus.NewCounterVec(prometheus.CounterOpts{
|
||||||
Name: metricName,
|
Name: metricName,
|
||||||
Help: help,
|
Help: help,
|
||||||
}, labelsNames(labels))
|
}, labelNames(labels))
|
||||||
if err := prometheus.Register(counterVec); err != nil {
|
if err := prometheus.Register(counterVec); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ func (c *GaugeContainer) Get(metricName string, labels prometheus.Labels, help s
|
||||||
gaugeVec = prometheus.NewGaugeVec(prometheus.GaugeOpts{
|
gaugeVec = prometheus.NewGaugeVec(prometheus.GaugeOpts{
|
||||||
Name: metricName,
|
Name: metricName,
|
||||||
Help: help,
|
Help: help,
|
||||||
}, labelsNames(labels))
|
}, labelNames(labels))
|
||||||
if err := prometheus.Register(gaugeVec); err != nil {
|
if err := prometheus.Register(gaugeVec); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ func (c *SummaryContainer) Get(metricName string, labels prometheus.Labels, help
|
||||||
Name: metricName,
|
Name: metricName,
|
||||||
Help: help,
|
Help: help,
|
||||||
Objectives: objectives,
|
Objectives: objectives,
|
||||||
}, labelsNames(labels))
|
}, labelNames(labels))
|
||||||
if err := prometheus.Register(summaryVec); err != nil {
|
if err := prometheus.Register(summaryVec); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -204,7 +204,7 @@ func (c *HistogramContainer) Get(metricName string, labels prometheus.Labels, he
|
||||||
Name: metricName,
|
Name: metricName,
|
||||||
Help: help,
|
Help: help,
|
||||||
Buckets: buckets,
|
Buckets: buckets,
|
||||||
}, labelsNames(labels))
|
}, labelNames(labels))
|
||||||
if err := prometheus.Register(histogramVec); err != nil {
|
if err := prometheus.Register(histogramVec); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue