Merge remote-tracking branch 'origin/topic/timw/pid-start-time-metric'

* origin/topic/timw/pid-start-time-metric:
  Add process_start_time_seconds and process_pid metrics
This commit is contained in:
Tim Wojtulewicz 2025-07-24 10:39:42 -07:00
commit 9c845d9979
5 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,7 @@
8.0.0-dev.740 | 2025-07-24 10:39:42 -0700
* Add process_start_time_seconds and process_pid metrics (Tim Wojtulewicz, Corelight)
8.0.0-dev.738 | 2025-07-24 08:00:57 -0700
* CI: Only run weekly tasks as part of cron (Tim Wojtulewicz, Corelight)

View file

@ -1 +1 @@
8.0.0-dev.738
8.0.0-dev.740

View file

@ -135,6 +135,10 @@ void Manager::InitPostScript() {
[]() { return static_cast<double>(get_stats()->fds); });
#endif
// These two metrics get set at startup and are never modified after.
process_start_time = GaugeInstance("process", "start_time", {}, "Process start time", "seconds");
process_start_time->Set(run_state::zeek_start_time);
if ( ! iosource_mgr->RegisterFd(collector_flare.FD(), this) ) {
reporter->FatalError("Failed to register telemetry collector descriptor");
}

View file

@ -282,6 +282,7 @@ private:
CounterPtr cpu_user_counter;
CounterPtr cpu_system_counter;
GaugePtr fds_gauge;
GaugePtr process_start_time;
std::shared_ptr<prometheus::Registry> prometheus_registry;
std::unique_ptr<prometheus::Exposer> prometheus_exposer;

View file

@ -5,9 +5,11 @@ process_cpu_system_seconds_total, [], >0.0, good
process_resident_memory_bytes, [], >0.0, good
process_virtual_memory_bytes, [], >0.0, good
process_open_fds, [], >0.0, good
process_start_time_seconds, [], >0.0, good
zeek_done
process_cpu_user_seconds_total, [], >0.0, good
process_cpu_system_seconds_total, [], >0.0, good
process_resident_memory_bytes, [], >0.0, good
process_virtual_memory_bytes, [], >0.0, good
process_open_fds, [], >0.0, good
process_start_time_seconds, [], >0.0, good