Skip to content

Commit e4eedd0

Browse files
committed
fix test
Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
1 parent 7c3ab62 commit e4eedd0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

cmd/addon-operator/main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import (
2121
"github.com/flant/kube-client/klogtolog"
2222
shapp "github.com/flant/shell-operator/pkg/app"
2323
"github.com/flant/shell-operator/pkg/debug"
24+
"github.com/flant/shell-operator/pkg/metrics"
25+
shmetrics "github.com/flant/shell-operator/pkg/metrics"
2426
utils_signal "github.com/flant/shell-operator/pkg/utils/signal"
2527
)
2628

@@ -71,6 +73,11 @@ func start(logger *log.Logger) func(_ *kingpin.ParseContext) error {
7173

7274
ctx := context.Background()
7375

76+
// Initialize metric names with the configured prefix
77+
shmetrics.InitMetrics(shapp.PrometheusMetricsPrefix)
78+
// Initialize addon-operator specific metrics
79+
metrics.InitMetrics(shapp.PrometheusMetricsPrefix)
80+
7481
operator := addon_operator.NewAddonOperator(ctx, nil, nil, addon_operator.WithLogger(logger.Named("addon-operator")))
7582

7683
operator.StartAPIServer()

pkg/addon-operator/operator.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import (
3636
"github.com/flant/shell-operator/pkg/debug"
3737
bc "github.com/flant/shell-operator/pkg/hook/binding_context"
3838
htypes "github.com/flant/shell-operator/pkg/hook/types"
39-
shmetrics "github.com/flant/shell-operator/pkg/metrics"
4039
shell_operator "github.com/flant/shell-operator/pkg/shell-operator"
4140
sh_task "github.com/flant/shell-operator/pkg/task"
4241
"github.com/flant/shell-operator/pkg/task/queue"
@@ -161,11 +160,6 @@ func NewAddonOperator(ctx context.Context, metricsStorage, hookMetricStorage met
161160
// Init logging subsystem.
162161
shapp.SetupLogging(rc, ao.Logger)
163162

164-
// Initialize metric names with the configured prefix
165-
shmetrics.InitMetrics(shapp.PrometheusMetricsPrefix)
166-
// Initialize addon-operator specific metrics
167-
InitMetrics(shapp.PrometheusMetricsPrefix)
168-
169163
// Have to initialize common operator to have all common dependencies below
170164
err := so.AssembleCommonOperator(app.ListenAddress, app.ListenPort, []string{
171165
"module",

0 commit comments

Comments
 (0)