Split Prometheus collector into own package

This commit is contained in:
Dominik Honnef committed 2016-12-29 17:10:43 +01:00
1 parent be9ee46c20
commit 00ae0aaf53
3 files changed
+204 -195

No files matched your search

+2 -2
View File
@@ -3,14 +3,14 @@ package main
import (
"net/http"
"honnef.co/go/nut"
"honnef.co/go/nut/nutcollector"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
func main() {
c := nut.NewCollector([]string{"localhost"})
c := nutcollector.New([]string{"localhost"})
prometheus.MustRegister(c)
http.Handle("/metrics", promhttp.Handler())
http.ListenAndServe(":9999", nil)