mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 16:47:32 +00:00
fix(mirror): initialize meter to prevent panic (#9712)
# Which Problems Are Solved With the change of #9561, the `mirror` command panics as there's no metrics provider configured. # How the Problems Are Solved Correctly initialize the provider (no-op by default) for the mirror command. # Additional Changes None # Additional Context relates to #9561 -> needs backports to 2.66.x - 2.71.x and 3.0.0-rc Co-authored-by: Stefan Benz <46600784+stebenz@users.noreply.github.com>
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
"github.com/zitadel/zitadel/internal/database"
|
||||
"github.com/zitadel/zitadel/internal/domain"
|
||||
"github.com/zitadel/zitadel/internal/id"
|
||||
metrics "github.com/zitadel/zitadel/internal/telemetry/metrics/config"
|
||||
)
|
||||
|
||||
type Migration struct {
|
||||
@@ -26,6 +27,7 @@ type Migration struct {
|
||||
|
||||
Log *logging.Config
|
||||
Machine *id.Config
|
||||
Metrics metrics.Config
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -40,6 +42,9 @@ func mustNewMigrationConfig(v *viper.Viper) *Migration {
|
||||
err := config.Log.SetLogger()
|
||||
logging.OnError(err).Fatal("unable to set logger")
|
||||
|
||||
err = config.Metrics.NewMeter()
|
||||
logging.OnError(err).Fatal("unable to set meter")
|
||||
|
||||
id.Configure(config.Machine)
|
||||
|
||||
return config
|
||||
|
Reference in New Issue
Block a user