From f4984952bc9259a34b93b4bdf7581c1e586e7b36 Mon Sep 17 00:00:00 2001
From: bzg1107 <preloyalwhite@163.com>
Date: Sat, 31 Jul 2021 16:36:48 +0800
Subject: [PATCH] fix promu dependence and fix not found web

---
 Makefile.common | 10 ++++++----
 main.go         |  5 +----
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/Makefile.common b/Makefile.common
index ce80d53..d33966d 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -261,11 +261,13 @@ common-docker-manifest:
 promu: $(PROMU)
 
 $(PROMU):
-	$(eval PROMU_TMP := $(shell mktemp -d))
-	curl -s -L $(PROMU_URL) | tar -xvzf - -C $(PROMU_TMP)
+#	$(eval PROMU_TMP := $(shell mktemp -d))
+#	curl -s -L $(PROMU_URL) | tar -xvzf - -C $(PROMU_TMP)
+#	mkdir -p $(FIRST_GOPATH)/bin
+#	cp $(PROMU_TMP)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM)/promu $(FIRST_GOPATH)/bin/promu
+#	rm -r $(PROMU_TMP)
 	mkdir -p $(FIRST_GOPATH)/bin
-	cp $(PROMU_TMP)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM)/promu $(FIRST_GOPATH)/bin/promu
-	rm -r $(PROMU_TMP)
+	cp /usr/bin/promu $(FIRST_GOPATH)/bin/promu	
 
 .PHONY: proto
 proto:
diff --git a/main.go b/main.go
index 0c47d9d..bdf61e8 100644
--- a/main.go
+++ b/main.go
@@ -34,8 +34,6 @@ import (
 	"github.com/prometheus/common/promlog"
 	"github.com/prometheus/common/route"
 	"github.com/prometheus/common/version"
-	"github.com/prometheus/exporter-toolkit/web"
-	webflag "github.com/prometheus/exporter-toolkit/web/kingpinflag"
 	"gopkg.in/alecthomas/kingpin.v2"
 
 	dto "github.com/prometheus/client_model/go"
@@ -61,7 +59,6 @@ func (lf logFunc) Println(v ...interface{}) {
 func main() {
 	var (
 		app                 = kingpin.New(filepath.Base(os.Args[0]), "The Pushgateway")
-		webConfig           = webflag.AddFlags(app)
 		listenAddress       = app.Flag("web.listen-address", "Address to listen on for the web interface, API, and telemetry.").Default(":9091").String()
 		metricsPath         = app.Flag("web.telemetry-path", "Path under which to expose metrics.").Default("/metrics").String()
 		externalURL         = app.Flag("web.external-url", "The URL under which the Pushgateway is externally reachable.").Default("").URL()
@@ -195,7 +192,7 @@ func main() {
 	mux.Handle(apiPath+"/v1/", http.StripPrefix(apiPath+"/v1", av1))
 
 	go closeListenerOnQuit(l, quitCh, logger)
-	err = web.Serve(l, &http.Server{Addr: *listenAddress, Handler: mux}, *webConfig, logger)
+	err = (&http.Server{Addr: *listenAddress, Handler: mux}).Serve(l)
 	level.Error(logger).Log("msg", "HTTP server stopped", "err", err)
 	// To give running connections a chance to submit their payload, we wait
 	// for 1sec, but we don't want to wait long (e.g. until all connections
-- 
2.30.0

