mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-10 17:45:36 +00:00
Do not start metrics collector if metrics are disabled (#4667)
This commit is contained in:
parent
ba68b446c0
commit
7d64138855
1 changed files with 2 additions and 2 deletions
|
@ -111,8 +111,6 @@ 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 {
|
||||
|
@ -260,6 +258,8 @@ 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()))
|
||||
|
|
Loading…
Reference in a new issue