rcserver: implement prometheus metrics on a dedicated port - fixes #7940

This commit is contained in:
Oleg Kunitsyn
2024-09-06 16:00:36 +02:00
committed by GitHub
parent 26bc9826e5
commit d15704ef9f
9 changed files with 226 additions and 79 deletions

View File

@ -421,11 +421,18 @@ func initConfig() {
}
// Start the remote control server if configured
_, err = rcserver.Start(context.Background(), &rc.Opt)
_, err = rcserver.Start(ctx, &rc.Opt)
if err != nil {
log.Fatalf("Failed to start remote control: %v", err)
}
// Start the metrics server if configured
_, err = rcserver.MetricsStart(ctx, &rc.Opt)
if err != nil {
log.Fatalf("Failed to start metrics server: %v", err)
}
// Setup CPU profiling if desired
if *cpuProfile != "" {
fs.Infof(nil, "Creating CPU profile %q\n", *cpuProfile)