mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-10 20:22:31 +02:00
Check if Prometheus is enabled in prometheus.AddGaugeFunc
This commit is contained in:
@@ -171,6 +171,10 @@ func SetBufferMaxSize(t string, size int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func AddGaugeFunc(name, help string, f func() float64) {
|
func AddGaugeFunc(name, help string, f func() float64) {
|
||||||
|
if !enabled {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
gauge := prometheus.NewGaugeFunc(prometheus.GaugeOpts{
|
gauge := prometheus.NewGaugeFunc(prometheus.GaugeOpts{
|
||||||
Namespace: config.PrometheusNamespace,
|
Namespace: config.PrometheusNamespace,
|
||||||
Name: name,
|
Name: name,
|
||||||
|
Reference in New Issue
Block a user