diff --git a/docs/data/tetragon_flags.yaml b/docs/data/tetragon_flags.yaml index 9db82334e7a..11b1da257f0 100644 --- a/docs/data/tetragon_flags.yaml +++ b/docs/data/tetragon_flags.yaml @@ -168,7 +168,9 @@ options: default_value: /var/run/docker/netns/ usage: Network namespace dir - name: pprof-addr - usage: Profile via pprof http + - name: pprof-address + usage: | + Serves runtime profile data via HTTP (e.g. 'localhost:6060'). Disabled by default - name: process-cache-size default_value: "65536" usage: Size of the process cache diff --git a/pkg/option/flags.go b/pkg/option/flags.go index e084ea9b6e5..8ca55b50b0f 100644 --- a/pkg/option/flags.go +++ b/pkg/option/flags.go @@ -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" @@ -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) @@ -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")