diff --git a/cmd/server/server.go b/cmd/server/server.go index 75fe27fec..c6e274454 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -122,6 +122,8 @@ func run(ctx context.Context, c *cli.Command) error { log.Info().Msgf("starting Woodpecker server with version '%s'", version.String()) + startMetricsCollector(ctx, _store) + serviceWaitingGroup.Go(func() error { log.Info().Msg("starting cron service ...") if err := cron.Run(ctx, _store); err != nil { @@ -269,8 +271,6 @@ func run(ctx context.Context, c *cli.Command) error { } if metricsServerAddr := c.String("metrics-server-addr"); metricsServerAddr != "" { - startMetricsCollector(ctx, _store) - serviceWaitingGroup.Go(func() error { metricsRouter := gin.New() metricsRouter.GET("/metrics", gin.WrapH(prometheus_http.Handler()))