feat: add basic prometheus metrics integration
Some checks reported errors
Cadoles/bouncer/pipeline/head Something is wrong with the build of this commit

This commit is contained in:
2023-06-30 10:26:27 -06:00
parent 5bf391b6bf
commit 56609ec316
16 changed files with 344 additions and 47 deletions

View File

@ -4,7 +4,6 @@ import (
"forge.cadoles.com/cadoles/bouncer/internal/config"
"github.com/pkg/errors"
"github.com/urfave/cli/v2"
"gitlab.com/wpetit/goweb/logger"
)
func LoadConfig(ctx *cli.Context) (*config.Config, error) {
@ -16,15 +15,11 @@ func LoadConfig(ctx *cli.Context) (*config.Config, error) {
)
if configFile != "" {
logger.Info(ctx.Context, "loading config", logger.F("config", configFile))
conf, err = config.NewFromFile(configFile)
if err != nil {
return nil, errors.Wrapf(err, "Could not load config file '%s'", configFile)
}
} else {
logger.Info(ctx.Context, "using default config")
conf = config.NewDefault()
}

View File

@ -18,6 +18,8 @@ func Dump() *cli.Command {
Usage: "Dump the current configuration",
Flags: flags,
Action: func(ctx *cli.Context) error {
logger.SetLevel(logger.LevelError)
conf, err := common.LoadConfig(ctx)
if err != nil {
return errors.Wrap(err, "Could not load configuration")