app-exporter/apps/vaultwarden.go

22 lines
395 B
Go
Raw Permalink Normal View History

2024-10-31 20:42:28 +01:00
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)
}