1
0

fix(metrics): make currently active users actually work

This commit is contained in:
kolaente
2022-11-09 21:12:17 +01:00
parent a9e6776abf
commit 811514855b
2 changed files with 13 additions and 7 deletions

View File

@ -113,7 +113,7 @@ func InitMetrics() {
log.Criticalf("Could not register metrics for %s: %s", TaskCountKey, err)
}
// Register total user count metric
// Register total teams count metric
err = registry.Register(promauto.NewGaugeFunc(prometheus.GaugeOpts{
Name: "vikunja_team_count",
Help: "The total number of teams on this instance",
@ -124,9 +124,11 @@ func InitMetrics() {
if err != nil {
log.Criticalf("Could not register metrics for %s: %s", TeamCountKey, err)
}
setupActiveUsersMetric()
}
// GetCount returns the current count from redis
// GetCount returns the current count from keyvalue
func GetCount(key string) (count int64, err error) {
cnt, exists, err := keyvalue.Get(key)
if err != nil {