tailscale-exporter/pkg/metrics/metrics.go
Marcus Noble c0163bd9af
Initial release
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-07-29 21:48:11 +01:00

20 lines
522 B
Go

package metrics
import (
"tailscale-exporter/pkg/tailscale"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
)
var defaultCollectors = []prometheus.Collector{
collectors.NewGoCollector(),
collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}),
}
func Collect(client *tailscale.Client, reg *prometheus.Registry) {
reg.MustRegister(defaultCollectors...)
reg.MustRegister(collectKeys(client)...)
reg.MustRegister(collectDevices(client)...)
}