1
0
mirror of https://github.com/nginxinc/nginx-prometheus-exporter.git synced 2025-08-08 05:02:04 +03:00

Add const labels to upMetric

This commit is contained in:
Robert Toth
2020-04-17 13:35:59 +02:00
committed by Dean Coakley
parent 39585bd443
commit 6a9964bcce
3 changed files with 7 additions and 6 deletions

View File

@@ -11,11 +11,12 @@ func newGlobalMetric(namespace string, metricName string, docString string, cons
return prometheus.NewDesc(namespace+"_"+metricName, docString, nil, constLabels)
}
func newUpMetric(namespace string) prometheus.Gauge {
func newUpMetric(namespace string, constLabels map[string]string) prometheus.Gauge {
return prometheus.NewGauge(prometheus.GaugeOpts{
Namespace: namespace,
Name: "up",
Help: "Status of the last metric scrape",
Namespace: namespace,
Name: "up",
Help: "Status of the last metric scrape",
ConstLabels: constLabels,
})
}