mirror of
https://github.com/rwinkhart/uni-nut.git
synced 2026-10-27 11:09:57 -04:00
Split Prometheus collector into own package
This commit is contained in:
1 parent
be9ee46c20
commit
00ae0aaf53
3 files changed
+204
-195
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user