Explorar el Código

Don;t launch Prometheus server if Prometheus binding is not provided

DarthSim hace 7 años
padre
commit
08c9077fe4
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      prometheus.go

+ 4 - 0
prometheus.go

@@ -20,6 +20,10 @@ var (
 )
 
 func initPrometheus() {
+	if len(conf.PrometheusBind) == 0 {
+		return
+	}
+
 	prometheusRequestsTotal = prometheus.NewCounter(prometheus.CounterOpts{
 		Name: "requests_total",
 		Help: "A counter of the total number of HTTP requests imgproxy processed.",