Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Build fails : undefined: prometheus.Handler #5

Open
pl0ink opened this issue Oct 2, 2019 · 0 comments · May be fixed by #6
Open

Build fails : undefined: prometheus.Handler #5

pl0ink opened this issue Oct 2, 2019 · 0 comments · May be fixed by #6

Comments

@pl0ink
Copy link

pl0ink commented Oct 2, 2019

Build fails with error message:
./hpraid_exporter.go:198:28: undefined: prometheus.Handler

Cause:
Recent change in the prometheus/client_golang repo
(encountered using version 1.1.0)

Solution:
Add import for:
"github.com/prometheus/client_golang/prometheus/promhttp"

in main() replace:
http.Handle(StartParams.Path, prometheus.Handler())
with:
http.Handle(StartParams.Path, promhttp.Handler())

@nudgegoonies nudgegoonies linked a pull request Jul 8, 2020 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant