Enable pprof endpoints on metrics server
Using the helper from `pkg/runtime/pprof`, which follows the suggestion from controller-runtime to use `AddMetricsExtraHandler`. Signed-off-by: Hidde Beydals <hello@hidde.co>
This commit is contained in:
parent
caa4edc510
commit
3ee2f904e1
2
go.mod
2
go.mod
|
@ -12,7 +12,7 @@ require (
|
|||
github.com/fluxcd/image-reflector-controller/api v0.4.0
|
||||
github.com/fluxcd/pkg/apis/meta v0.7.0
|
||||
github.com/fluxcd/pkg/gittestserver v0.1.0
|
||||
github.com/fluxcd/pkg/runtime v0.8.0
|
||||
github.com/fluxcd/pkg/runtime v0.8.1
|
||||
github.com/fluxcd/source-controller v0.7.0
|
||||
// If you bump this, change SOURCE_VER in the Makefile to match
|
||||
github.com/fluxcd/source-controller/api v0.7.0
|
||||
|
|
3
go.sum
3
go.sum
|
@ -310,8 +310,9 @@ github.com/fluxcd/pkg/gittestserver v0.1.0 h1:BvIG+bBhgbmqhtpSS2qUpOXRIL1P1Ow2ja
|
|||
github.com/fluxcd/pkg/gittestserver v0.1.0/go.mod h1:HWZaoib03fQeSsauCAN2iAFdr6bnjKQ+CFxMFD2mwDY=
|
||||
github.com/fluxcd/pkg/helmtestserver v0.1.0/go.mod h1:3L+tbPn74PsHwHsyhbfk/kZAosrwMFTTA92XEFiwVAE=
|
||||
github.com/fluxcd/pkg/lockedfile v0.0.5/go.mod h1:uAtPUBId6a2RqO84MTH5HKGX0SbM1kNW3Wr/FhYyDVA=
|
||||
github.com/fluxcd/pkg/runtime v0.8.0 h1:cnSBZJLcXlKgjXpFFFExu+4ZncIxmPgNIx+ErLcCLnA=
|
||||
github.com/fluxcd/pkg/runtime v0.8.0/go.mod h1:tQwEN+RESjJmtwSSv7I+6bkNM9raIXpGsCjruaIVX6A=
|
||||
github.com/fluxcd/pkg/runtime v0.8.1 h1:8UxNz7GeI/HC3U5tpNCfrjRx2V7UjUegQOwCsd+EWxk=
|
||||
github.com/fluxcd/pkg/runtime v0.8.1/go.mod h1:tQwEN+RESjJmtwSSv7I+6bkNM9raIXpGsCjruaIVX6A=
|
||||
github.com/fluxcd/pkg/ssh v0.0.5 h1:rnbFZ7voy2JBlUfMbfyqArX2FYaLNpDhccGFC3qW83A=
|
||||
github.com/fluxcd/pkg/ssh v0.0.5/go.mod h1:7jXPdXZpc0ttMNz2kD9QuMi3RNn/e0DOFbj0Tij/+Hs=
|
||||
github.com/fluxcd/pkg/testserver v0.0.2/go.mod h1:pgUZTh9aQ44FSTQo+5NFlh7YMbUfdz1B80DalW7k96Y=
|
||||
|
|
4
main.go
4
main.go
|
@ -17,7 +17,6 @@ limitations under the License.
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/fluxcd/pkg/runtime/client"
|
||||
"os"
|
||||
|
||||
flag "github.com/spf13/pflag"
|
||||
|
@ -28,9 +27,11 @@ import (
|
|||
ctrlmetrics "sigs.k8s.io/controller-runtime/pkg/metrics"
|
||||
|
||||
imagev1alpha1_reflect "github.com/fluxcd/image-reflector-controller/api/v1alpha1"
|
||||
"github.com/fluxcd/pkg/runtime/client"
|
||||
"github.com/fluxcd/pkg/runtime/events"
|
||||
"github.com/fluxcd/pkg/runtime/logger"
|
||||
"github.com/fluxcd/pkg/runtime/metrics"
|
||||
"github.com/fluxcd/pkg/runtime/pprof"
|
||||
"github.com/fluxcd/pkg/runtime/probes"
|
||||
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
|
||||
|
||||
|
@ -117,6 +118,7 @@ func main() {
|
|||
}
|
||||
|
||||
probes.SetupChecks(mgr, setupLog)
|
||||
pprof.SetupHandlers(mgr, setupLog)
|
||||
|
||||
if err = (&controllers.ImageUpdateAutomationReconciler{
|
||||
Client: mgr.GetClient(),
|
||||
|
|
Loading…
Reference in New Issue