1
0

Fixed metrics endpoint not working

This commit is contained in:
konrad
2019-05-12 16:49:16 +02:00
parent 3d7fd9ca20
commit de24fcc2f8
5 changed files with 41 additions and 23 deletions

View File

@ -19,12 +19,13 @@ package metrics
import (
"code.vikunja.io/api/pkg/log"
"code.vikunja.io/api/pkg/red"
"github.com/go-redis/redis"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/spf13/viper"
)
var r = red.GetRedis()
var r *redis.Client
const (
// ListCountKey is the name of the key in which we save the list count
@ -43,7 +44,10 @@ const (
TeamCountKey = `teamcount`
)
func init() {
// InitMetrics Initializes the metrics
func InitMetrics() {
r = red.GetRedis()
// Register total list count metric
promauto.NewGaugeFunc(prometheus.GaugeOpts{
Name: "vikunja_list_count",