Skip to content

Commit

Permalink
metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
ThinkChaos committed Apr 1, 2024
1 parent a242238 commit ecc34d7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@ func NewServer(ctx context.Context, cfg *config.Config) (server *Server, err err
return nil, err
}

if len(httpListeners) != 0 || len(httpsListeners) != 0 {
metrics.Start(httpRouter, cfg.Prometheus)
metrics.Start(httpsRouter, cfg.Prometheus)
}

metrics.RegisterEventListeners()

bootstrap, err := resolver.NewBootstrap(ctx, cfg)
Expand Down Expand Up @@ -174,11 +169,13 @@ func NewServer(ctx context.Context, cfg *config.Config) (server *Server, err err
if len(cfg.Ports.HTTP) != 0 {
api.RegisterOpenAPIEndpoints(httpRouter, openAPIImpl)
server.registerDoHEndpoints(httpRouter)
metrics.Start(httpRouter, cfg.Prometheus)
}

if len(cfg.Ports.HTTPS) != 0 {
api.RegisterOpenAPIEndpoints(httpsRouter, openAPIImpl)
server.registerDoHEndpoints(httpsRouter)
metrics.Start(httpsRouter, cfg.Prometheus)
}

return server, err
Expand Down

0 comments on commit ecc34d7

Please sign in to comment.