Initila commit
Build Docker image on push / docker (push) Successful in 22s

This commit is contained in:
2026-08-18 00:46:59 +02:00
commit 9db7aa2560
28 changed files with 2823 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
package collector
import (
"sync"
"github.com/prometheus/client_golang/prometheus"
)
// Group registers multiple device collectors as one Prometheus collector.
// Collecting devices concurrently prevents one slow device from delaying all others.
type Group []prometheus.Collector
// Describe forwards descriptors from every registered device collector.
func (group Group) Describe(channel chan<- *prometheus.Desc) {
for _, deviceCollector := range group {
deviceCollector.Describe(channel)
}
}
// Collect scrapes all configured devices concurrently.
func (group Group) Collect(channel chan<- prometheus.Metric) {
var waitGroup sync.WaitGroup
waitGroup.Add(len(group))
for _, deviceCollector := range group {
go func(current prometheus.Collector) {
defer waitGroup.Done()
current.Collect(channel)
}(deviceCollector)
}
waitGroup.Wait()
}