app-exporter/apps/forgejo_runner.go
2024-10-31 20:50:09 +01:00

21 lines
423 B
Go

package apps
import (
"log"
"os/exec"
"strings"
"github.com/prometheus/client_golang/prometheus"
)
func ForgejoRunner(m Metrics) {
out, err := exec.Command("forgejo_runner", "--version").Output()
if err != nil {
log.Printf(">> WARN: Unable to get Forgejo_runner version: %v", err)
return
}
version := strings.Split(string(out), " ")[2]
m.ForgejoRunner.With(prometheus.Labels{"version": version}).Set(1)
}