mirror of
https://github.com/imgproxy/imgproxy.git
synced 2024-11-24 08:12:38 +02:00
Check if Prometheus is enabled in prometheus.AddGaugeFunc
This commit is contained in:
parent
82c6718edb
commit
68ed8708ea
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user