added manger to keep track of go routines in the services (#2869)
- added manager to wait for all go routines to end before exit - code refactor - renamed Manafer to Interface and GoRoutineManager to GroupManager - replaced some go routine calls with manager Add func - added unit tests for manager
This commit is contained in:
@@ -26,9 +26,10 @@ import (
|
||||
"sigs.k8s.io/controller-runtime/pkg/metrics"
|
||||
|
||||
"github.com/fission/fission/pkg/utils/httpserver"
|
||||
"github.com/fission/fission/pkg/utils/manager"
|
||||
)
|
||||
|
||||
func ServeMetrics(ctx context.Context, parent string, logger *zap.Logger) {
|
||||
func ServeMetrics(ctx context.Context, parent string, logger *zap.Logger, mgr manager.Interface) {
|
||||
metricsAddr := os.Getenv("METRICS_ADDR")
|
||||
if metricsAddr == "" {
|
||||
metricsAddr = "8080"
|
||||
@@ -45,5 +46,5 @@ func ServeMetrics(ctx context.Context, parent string, logger *zap.Logger) {
|
||||
EnableOpenMetrics: true,
|
||||
},
|
||||
))
|
||||
httpserver.StartServer(ctx, logger, parent+"/metrics", metricsAddr, mux)
|
||||
httpserver.StartServer(ctx, logger, mgr, parent+"/metrics", metricsAddr, mux)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user