Skip to content

Commit

Permalink
Allow Pprof and Superisor metrics in standalone mode (#10576)
Browse files Browse the repository at this point in the history
* Allow pprof to run on server with `--disable-agent`
* Allow supervisor metrics to run on server with `--disable-agent`

Signed-off-by: Derek Nola <derek.nola@suse.com>
  • Loading branch information
dereknola committed Jul 26, 2024
1 parent ecff337 commit a70157c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/agent/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,18 @@ func RunStandalone(ctx context.Context, cfg cmds.Agent) error {
return err
}

if nodeConfig.SupervisorMetrics {
if err := metrics.DefaultMetrics.Start(ctx, nodeConfig); err != nil {
return errors.Wrap(err, "failed to serve metrics")
}
}

if nodeConfig.EnablePProf {
if err := profile.DefaultProfiler.Start(ctx, nodeConfig); err != nil {
return errors.Wrap(err, "failed to serve pprof")
}
}

<-ctx.Done()
return ctx.Err()
}
Expand Down

0 comments on commit a70157c

Please sign in to comment.