Skip to content

Commit

Permalink
Expose the pprof server in the operator (open-telemetry#1998)
Browse files Browse the repository at this point in the history
* Add changelog

Signed-off-by: Israel Blancas <[email protected]>

* Expose pprof server

Signed-off-by: Israel Blancas <[email protected]>

* Fix changelog

Signed-off-by: Israel Blancas <[email protected]>

* Apply changes requested in CR

Signed-off-by: Israel Blancas <[email protected]>

---------

Signed-off-by: Israel Blancas <[email protected]>
  • Loading branch information
iblancasa authored Aug 9, 2023
1 parent 3c71f11 commit 2aac83b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .chloggen/1997-expose-pprof-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action)
component: operator

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add flag to enable support for the pprof server in the operator.

# One or more tracking issues related to the change
issues: [1997]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func main() {
var (
metricsAddr string
probeAddr string
pprofAddr string
enableLeaderElection bool
collectorImage string
targetAllocatorImage string
Expand All @@ -107,6 +108,7 @@ func main() {

pflag.StringVar(&metricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.")
pflag.StringVar(&probeAddr, "health-probe-addr", ":8081", "The address the probe endpoint binds to.")
pflag.StringVar(&pprofAddr, "pprof-addr", "", "The address to expose the pprof server. Default is empty string which disables the pprof server.")
pflag.BoolVar(&enableLeaderElection, "enable-leader-election", false,
"Enable leader election for controller manager. "+
"Enabling this will ensure there is only one active controller manager.")
Expand Down Expand Up @@ -203,6 +205,7 @@ func main() {
LeaseDuration: &leaseDuration,
RenewDeadline: &renewDeadline,
RetryPeriod: &retryPeriod,
PprofBindAddress: pprofAddr,
WebhookServer: webhook.NewServer(webhook.Options{
Port: webhookPort,
TLSOpts: optionsTlSOptsFuncs,
Expand Down

0 comments on commit 2aac83b

Please sign in to comment.