forked from kbudde/rabbitmq_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetrics.go
More file actions
36 lines (31 loc) · 762 Bytes
/
metrics.go
File metadata and controls
36 lines (31 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package main
import "github.com/prometheus/client_golang/prometheus"
const (
namespace = "rabbitmq"
)
func newGaugeVec(metricName string, docString string, labels []string) *prometheus.GaugeVec {
return prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: namespace,
Name: metricName,
Help: docString,
},
labels,
)
}
func newGauge(metricName string, docString string) prometheus.Gauge {
return prometheus.NewGauge(
prometheus.GaugeOpts{
Namespace: namespace,
Name: metricName,
Help: docString,
},
)
}
func newDesc(metricName string, docString string, labels []string) *prometheus.Desc {
return prometheus.NewDesc(
prometheus.BuildFQName(namespace, "", metricName),
docString,
labels,
nil)
}