Skip to content

Commit 3ee2f90

Browse files
committed
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 <[email protected]>
1 parent caa4edc commit 3ee2f90

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/fluxcd/image-reflector-controller/api v0.4.0
1313
github.com/fluxcd/pkg/apis/meta v0.7.0
1414
github.com/fluxcd/pkg/gittestserver v0.1.0
15-
github.com/fluxcd/pkg/runtime v0.8.0
15+
github.com/fluxcd/pkg/runtime v0.8.1
1616
github.com/fluxcd/source-controller v0.7.0
1717
// If you bump this, change SOURCE_VER in the Makefile to match
1818
github.com/fluxcd/source-controller/api v0.7.0

go.sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,9 @@ github.com/fluxcd/pkg/gittestserver v0.1.0 h1:BvIG+bBhgbmqhtpSS2qUpOXRIL1P1Ow2ja
310310
github.com/fluxcd/pkg/gittestserver v0.1.0/go.mod h1:HWZaoib03fQeSsauCAN2iAFdr6bnjKQ+CFxMFD2mwDY=
311311
github.com/fluxcd/pkg/helmtestserver v0.1.0/go.mod h1:3L+tbPn74PsHwHsyhbfk/kZAosrwMFTTA92XEFiwVAE=
312312
github.com/fluxcd/pkg/lockedfile v0.0.5/go.mod h1:uAtPUBId6a2RqO84MTH5HKGX0SbM1kNW3Wr/FhYyDVA=
313-
github.com/fluxcd/pkg/runtime v0.8.0 h1:cnSBZJLcXlKgjXpFFFExu+4ZncIxmPgNIx+ErLcCLnA=
314313
github.com/fluxcd/pkg/runtime v0.8.0/go.mod h1:tQwEN+RESjJmtwSSv7I+6bkNM9raIXpGsCjruaIVX6A=
314+
github.com/fluxcd/pkg/runtime v0.8.1 h1:8UxNz7GeI/HC3U5tpNCfrjRx2V7UjUegQOwCsd+EWxk=
315+
github.com/fluxcd/pkg/runtime v0.8.1/go.mod h1:tQwEN+RESjJmtwSSv7I+6bkNM9raIXpGsCjruaIVX6A=
315316
github.com/fluxcd/pkg/ssh v0.0.5 h1:rnbFZ7voy2JBlUfMbfyqArX2FYaLNpDhccGFC3qW83A=
316317
github.com/fluxcd/pkg/ssh v0.0.5/go.mod h1:7jXPdXZpc0ttMNz2kD9QuMi3RNn/e0DOFbj0Tij/+Hs=
317318
github.com/fluxcd/pkg/testserver v0.0.2/go.mod h1:pgUZTh9aQ44FSTQo+5NFlh7YMbUfdz1B80DalW7k96Y=

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package main
1818

1919
import (
20-
"github.com/fluxcd/pkg/runtime/client"
2120
"os"
2221

2322
flag "github.com/spf13/pflag"
@@ -28,9 +27,11 @@ import (
2827
ctrlmetrics "sigs.k8s.io/controller-runtime/pkg/metrics"
2928

3029
imagev1alpha1_reflect "github.com/fluxcd/image-reflector-controller/api/v1alpha1"
30+
"github.com/fluxcd/pkg/runtime/client"
3131
"github.com/fluxcd/pkg/runtime/events"
3232
"github.com/fluxcd/pkg/runtime/logger"
3333
"github.com/fluxcd/pkg/runtime/metrics"
34+
"github.com/fluxcd/pkg/runtime/pprof"
3435
"github.com/fluxcd/pkg/runtime/probes"
3536
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
3637

@@ -117,6 +118,7 @@ func main() {
117118
}
118119

119120
probes.SetupChecks(mgr, setupLog)
121+
pprof.SetupHandlers(mgr, setupLog)
120122

121123
if err = (&controllers.ImageUpdateAutomationReconciler{
122124
Client: mgr.GetClient(),

0 commit comments

Comments
 (0)