소스 검색

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.",