package main import ( "context" "fmt" "net/http" "git.faercol.me/monitoring/sys-exporter/registry" "github.com/prometheus/client_golang/prometheus/promhttp" _ "git.faercol.me/monitoring/sys-exporter/collector/loadavg" _ "git.faercol.me/monitoring/sys-exporter/collector/meminfo" _ "git.faercol.me/monitoring/sys-exporter/collector/pacman" _ "git.faercol.me/monitoring/sys-exporter/collector/systemd" _ "git.faercol.me/monitoring/sys-exporter/collector/uptime" ) // type gatherer struct { // reg *prometheus.Registry // } // func (g *gatherer) Gather() (pcm.MetricFamily, error) { // return g.reg. // } func main() { fmt.Println("starting server") registry.R.Run(context.Background()) http.Handle("/metrics", promhttp.HandlerFor(registry.R.PromRegistry(), promhttp.HandlerOpts{})) http.ListenAndServe(":2112", nil) }