diff --git a/flags/flags.go b/flags/flags.go index e41027aa51..251da7a797 100644 --- a/flags/flags.go +++ b/flags/flags.go @@ -259,6 +259,7 @@ type FlagsOTLP struct { // FlagsProfiling provides profiling configuration flags. type FlagsProfiling struct { Duration time.Duration `default:"5s" help:"The agent profiling duration to use. Leave this empty to use the defaults."` + LabelTTL time.Duration `default:"10m" help:"The interval at which the agent will refresh the labels of a tid."` CPUSamplingFrequency int `default:"${default_cpu_sampling_frequency}" help:"The frequency at which profiling data is collected, e.g., 19 samples per second."` PerfEventBufferPollInterval time.Duration `default:"250ms" help:"[deprecated] The interval at which the perf event buffer is polled for new events."` diff --git a/main.go b/main.go index 6cf059bf94..2ce250b341 100644 --- a/main.go +++ b/main.go @@ -329,6 +329,7 @@ func mainWithExitCode() flags.ExitCode { debuginfoClient, externalLabels, f.Profiling.Duration, + f.Profiling.LabelTTL, f.Debuginfo.Strip, f.Debuginfo.UploadMaxParallel, f.Debuginfo.UploadDisable || isOfflineMode, diff --git a/reporter/parca_reporter.go b/reporter/parca_reporter.go index b33979365b..38e8d124ea 100644 --- a/reporter/parca_reporter.go +++ b/reporter/parca_reporter.go @@ -518,6 +518,7 @@ func New( debuginfoClient debuginfogrpc.DebuginfoServiceClient, externalLabels []Label, reportInterval time.Duration, + labelTTL time.Duration, stripTextSection bool, symbolUploadConcurrency int, disableSymbolUpload bool, @@ -543,6 +544,7 @@ func New( if err != nil { return nil, err } + labels.SetLifetime(labelTTL) stacks, err := lru.NewSynced[libpf.TraceHash, stack](cacheSize, libpf.TraceHash.Hash32) if err != nil {