Browse Source

fix compile error with newer prometheus/client_golang versions

removed all http related features in v1.0.0, see
https://github.com/prometheus/client_golang/blob/master/CHANGELOG.md#100--2019-06-15

Signed-off-by: Andreas Schmid <service@aaschmid.de>
pull/1/head
Andreas Schmid 4 years ago
parent
commit
07def07c4b
  1. 3
      main.go

3
main.go

@ -28,6 +28,7 @@ import (
"github.com/namsral/flag" "github.com/namsral/flag"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
upnp "github.com/sberk42/fritzbox_exporter/fritzbox_upnp" upnp "github.com/sberk42/fritzbox_exporter/fritzbox_upnp"
) )
@ -320,7 +321,7 @@ func main() {
prometheus.MustRegister(collector) prometheus.MustRegister(collector)
prometheus.MustRegister(collect_errors) prometheus.MustRegister(collect_errors)
http.Handle("/metrics", prometheus.Handler()) http.Handle("/metrics", promhttp.Handler())
fmt.Printf("metrics available at http://%s/metrics\n", *flag_addr) fmt.Printf("metrics available at http://%s/metrics\n", *flag_addr)
log.Fatal(http.ListenAndServe(*flag_addr, nil)) log.Fatal(http.ListenAndServe(*flag_addr, nil))
} }

Loading…
Cancel
Save