diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index adabae869..903c92a4c 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -587,6 +587,8 @@ func server(c *cli.Context) error { return nil }) + setupMetrics(&g, store_) + // start the server with tls enabled if c.String("server-cert") != "" { g.Go(func() error { @@ -608,8 +610,6 @@ func server(c *cli.Context) error { return g.Wait() } - setupMetrics(g, store_) - // start the server without tls enabled if !c.Bool("lets-encrypt") { return http.ListenAndServe( diff --git a/cmd/drone-server/setup.go b/cmd/drone-server/setup.go index 046f1e2ae..72162ea86 100644 --- a/cmd/drone-server/setup.go +++ b/cmd/drone-server/setup.go @@ -205,7 +205,7 @@ func setupTree(c *cli.Context) *httptreemux.ContextMux { func before(c *cli.Context) error { return nil } -func setupMetrics(g errgroup.Group, store_ store.Store) { +func setupMetrics(g *errgroup.Group, store_ store.Store) { pendingJobs := promauto.NewGauge(prometheus.GaugeOpts{ Namespace: "drone", Name: "pending_jobs",