Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helm: add pprof flag setting #2846

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/content/en/docs/reference/helm-chart.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion docs/data/tetragon_flags.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions install/kubernetes/tetragon/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,7 @@ data:
{{- end }}
enable-pod-info: {{ .Values.tetragonOperator.podInfo.enabled | quote }}
enable-tracing-policy-crd: {{ .Values.tetragonOperator.tracingPolicy.enabled | quote }}
{{- if .Values.tetragon.pprof.enabled }}
pprof-address: {{ .Values.tetragon.pprof.address }}:{{ .Values.tetragon.pprof.port }}
{{- end }}
{{- include "configmap.extra" . | nindent 2 }}
7 changes: 7 additions & 0 deletions install/kubernetes/tetragon/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@ tetragon:
address: "localhost"
# -- The port at which to expose gops.
port: 8118
pprof:
# -- Whether to enable exposing pprof server.
enabled: false
# -- The address at which to expose pprof.
address: "localhost"
# -- The port at which to expose pprof.
port: 6060
# -- Enable policy filter. This is required for K8s namespace and pod-label filtering.
enablePolicyFilter: True
# -- Enable policy filter debug messages.
Expand Down
13 changes: 8 additions & 5 deletions pkg/option/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ const (
KeyTracingPolicy = "tracing-policy"
KeyTracingPolicyDir = "tracing-policy-dir"

KeyCpuProfile = "cpuprofile"
KeyMemProfile = "memprofile"
KeyPprofAddr = "pprof-addr"
KeyCpuProfile = "cpuprofile"
KeyMemProfile = "memprofile"
KeyPprofAddr = "pprof-address"
KeyDeprecatedPprofAddr = "pprof-addr"

KeyExportFilename = "export-filename"
KeyExportFileMaxSizeMB = "export-file-max-size-mb"
Expand Down Expand Up @@ -184,6 +185,7 @@ func ReadAndSetFlags() error {

Config.CpuProfile = viper.GetString(KeyCpuProfile)
Config.MemProfile = viper.GetString(KeyMemProfile)
Config.PprofAddr = viper.GetString(KeyDeprecatedPprofAddr)
Config.PprofAddr = viper.GetString(KeyPprofAddr)

Config.EventQueueSize = viper.GetUint(KeyEventQueueSize)
Expand Down Expand Up @@ -326,8 +328,9 @@ func AddFlags(flags *pflag.FlagSet) {
flags.String(KeyMemProfile, "", "Store MEM profile into provided file")
flags.MarkHidden(KeyMemProfile)

flags.String(KeyPprofAddr, "", "Profile via pprof http")
flags.MarkHidden(KeyPprofAddr)
flags.String(KeyPprofAddr, "", "Serves runtime profile data via HTTP (e.g. 'localhost:6060'). Disabled by default")
flags.String(KeyDeprecatedPprofAddr, "", "")
flags.MarkDeprecated(KeyDeprecatedPprofAddr, "please use --pprof-address")

// JSON export aggregation options.
flags.Bool(KeyEnableExportAggregation, false, "Enable JSON export aggregation")
Expand Down
Loading