add build information to metrics

Signed-off-by: David Christofas <dchristofas@owncloud.com>
This commit is contained in:
David Christofas
2020-09-25 13:15:20 +02:00
parent ff8fc23ce5
commit dab58c3637
6 changed files with 22 additions and 1 deletions
+1
View File
@@ -32,6 +32,7 @@ func Execute() error {
Flags: flagset.RootWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Version = version.String
return ParseConfig(c, cfg)
},
+4 -1
View File
@@ -2,6 +2,7 @@ package command
import (
"context"
"github.com/owncloud/ocis/glauth/pkg/metrics"
"os"
"os/signal"
"strings"
@@ -134,11 +135,13 @@ func Server(cfg *config.Config) *cli.Command {
var (
gr = run.Group{}
ctx, cancel = context.WithCancel(context.Background())
//metrics = metrics.New()
metrics = metrics.New()
)
defer cancel()
metrics.BuildInfo.WithLabelValues(cfg.Version).Set(1)
{
cfg := glauthcfg.Config{
LDAP: glauthcfg.LDAP{