Преглед на файлове

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

DarthSim преди 7 години
родител
ревизия
08c9077fe4
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  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.",