feat: add basic prometheus metrics integration
Some checks reported errors
Cadoles/bouncer/pipeline/head Something is wrong with the build of this commit
Some checks reported errors
Cadoles/bouncer/pipeline/head Something is wrong with the build of this commit
This commit is contained in:
@ -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()
|
||||
}
|
||||
|
||||
|
@ -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")
|
||||
|
Reference in New Issue
Block a user