Add process created_at time to procstat input (#7039)
This commit is contained in:
@@ -216,6 +216,11 @@ func (p *Procstat) addMetric(proc Process, acc telegraf.Accumulator) {
|
||||
fields[prefix+"write_bytes"] = io.WriteBytes
|
||||
}
|
||||
|
||||
createdAt, err := proc.CreateTime() //Returns epoch in ms
|
||||
if err == nil {
|
||||
fields[prefix+"created_at"] = createdAt * 1000000 //Convert ms to ns
|
||||
}
|
||||
|
||||
cpu_time, err := proc.Times()
|
||||
if err == nil {
|
||||
fields[prefix+"cpu_time_user"] = cpu_time.User
|
||||
|
||||
Reference in New Issue
Block a user