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

21 lines
395 B
Go

package apps
import (
"encoding/json"
"net/http"
"github.com/prometheus/client_golang/prometheus"
)
func Vaultwarden(m Metrics) {
var resp, err = http.Get("http://localhost:8080/api/version")
if err != nil {
return
}
defer resp.Body.Close()
var version = new(string)
json.NewDecoder(resp.Body).Decode(version)
m.Vaultwarden.With(prometheus.Labels{"version": *version}).Set(1)
}