Open maxbrunet opened 2 years ago
One small comment about something we need to revisit in the Agent as a whole is that caching PIDs can be problematic due to them being reused.
We should be able to add the starttime field of /proc/[pid]/stat to the cache key: awk '{print $23}' "/proc/${pid}/stat"
starttime
/proc/[pid]/stat
awk '{print $23}' "/proc/${pid}/stat"
https://pkg.go.dev/github.com/prometheus/procfs#ProcStat.StartTime
Originally posted by @maxbrunet in https://github.com/parca-dev/parca-agent/issues/960#issuecomment-1300932155
There are at least two caches to look into, in the discovery manager and in the label manager
cc @javierhonduco @kakkoyun
Yes! Exactly the approach I had in mind :). It's how I implemented a similar logic in rbperf to ensure that the right process is profiled, and was planning on reworking all this in the Agent at some point
We should be able to add the
starttime
field of/proc/[pid]/stat
to the cache key:awk '{print $23}' "/proc/${pid}/stat"
https://pkg.go.dev/github.com/prometheus/procfs#ProcStat.StartTime
Originally posted by @maxbrunet in https://github.com/parca-dev/parca-agent/issues/960#issuecomment-1300932155
There are at least two caches to look into, in the discovery manager and in the label manager
cc @javierhonduco @kakkoyun