mirror of
https://github.com/rwinkhart/uni-nut.git
synced 2026-09-02 23:17:31 -04:00
Split Prometheus collector into own package
This commit is contained in:
@@ -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