Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incompatible with prometheus/client_golang:master #45

Closed
filex opened this issue Jun 12, 2019 · 2 comments
Closed

incompatible with prometheus/client_golang:master #45

filex opened this issue Jun 12, 2019 · 2 comments

Comments

@filex
Copy link
Contributor

filex commented Jun 12, 2019

  • Varnish version irrevant
  • prometheus_varnish_exporter 1.4.1 and master

today, go build does not work anymore :(

$ (master) go build
# github.com/jonnenauha/prometheus_varnish_exporter
./main.go:179:33: undefined: prometheus.Handler

There is a recent change in the prometheus/client_golang repo prometheus/client_golang/pull/600 that seems to break the varnish exporter build.

The change in that PR suggest that the Handler now lives in promhttp:

diff --git a/main.go b/main.go
index 7c55c21..72abfd2 100644
--- a/main.go
+++ b/main.go
@@ -176,7 +176,7 @@ func main() {
                http.Handle(StartParams.Path, handler)
        } else {
                prometheus.MustRegister(PrometheusExporter)
-               http.Handle(StartParams.Path, prometheus.Handler())
+               http.Handle(StartParams.Path, promhttp.Handler())
        }
 
        if StartParams.Path != "/" {
@tomaaron
Copy link

Your fix works very well. I would appreciate the merge of the related PR!

@filex
Copy link
Contributor Author

filex commented Jun 20, 2019

Fixed in #46

@filex filex closed this as completed Jun 20, 2019
dcaba added a commit to dcaba/stackdriver_exporter that referenced this issue Oct 22, 2019
dcaba added a commit to dcaba/stackdriver_exporter that referenced this issue Apr 14, 2020
dcaba added a commit to dcaba/stackdriver_exporter that referenced this issue Apr 14, 2020
dcaba added a commit to dcaba/stackdriver_exporter that referenced this issue Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants