Is there was to get a process uptime as a counter, aside from creating a custom metric collector?
The only thing I found in Telegraf was procstat’s created_at field. It’s the epoch timestamp of when the process was started, and it can be used with Grafana’s data unit “From now”, but I’d much prefer a counter with the total number of seconds of uptime so far, as you can get for a host’s uptime.
It may be possible to use the starlark processor to do that math to get the amount of time since the created_at field and add it as a field to the final metric. Here is an example of some time manipulation with the starlark processor.
What is this sourcery?!
Love this starlak processor, wasn’t aware of it. And didn’t even cross my mind to use a processor I guess the execd could also be used, but why do that when there’s a built-in interpreter in Telegraf? Wow.