Check if Prometheus is enabled in prometheus.AddGaugeFunc

This commit is contained in:
DarthSim
2021-11-15 17:26:49 +06:00
parent 82c6718edb
commit 68ed8708ea

View File

@@ -171,6 +171,10 @@ func SetBufferMaxSize(t string, size int) {
}
func AddGaugeFunc(name, help string, f func() float64) {
if !enabled {
return
}
gauge := prometheus.NewGaugeFunc(prometheus.GaugeOpts{
Namespace: config.PrometheusNamespace,
Name: name,