mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2024-11-22 23:41:00 +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)
|
||||
)
|
||||
|
||||
func labelsNames(labels prometheus.Labels) []string {
|
||||
func labelNames(labels prometheus.Labels) []string {
|
||||
names := make([]string, 0, len(labels))
|
||||
for labelName := range labels {
|
||||
names = append(names, labelName)
|
||||
|
@ -91,7 +91,7 @@ func (c *CounterContainer) Get(metricName string, labels prometheus.Labels, help
|
|||
counterVec = prometheus.NewCounterVec(prometheus.CounterOpts{
|
||||
Name: metricName,
|
||||
Help: help,
|
||||
}, labelsNames(labels))
|
||||
}, labelNames(labels))
|
||||
if err := prometheus.Register(counterVec); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ func (c *GaugeContainer) Get(metricName string, labels prometheus.Labels, help s
|
|||
gaugeVec = prometheus.NewGaugeVec(prometheus.GaugeOpts{
|
||||
Name: metricName,
|
||||
Help: help,
|
||||
}, labelsNames(labels))
|
||||
}, labelNames(labels))
|
||||
if err := prometheus.Register(gaugeVec); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ func (c *SummaryContainer) Get(metricName string, labels prometheus.Labels, help
|
|||
Name: metricName,
|
||||
Help: help,
|
||||
Objectives: objectives,
|
||||
}, labelsNames(labels))
|
||||
}, labelNames(labels))
|
||||
if err := prometheus.Register(summaryVec); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ func (c *HistogramContainer) Get(metricName string, labels prometheus.Labels, he
|
|||
Name: metricName,
|
||||
Help: help,
|
||||
Buckets: buckets,
|
||||
}, labelsNames(labels))
|
||||
}, labelNames(labels))
|
||||
if err := prometheus.Register(histogramVec); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue