telemetry: Run callbacks at collect time

Calling collect_metrics() from a script would not invoke metric
callbacks, resulting in most of the process metrics to be zero
when a Zeek process isn't scraped via Prometheus.

Fixes #4309
This commit is contained in:
Arne Welzel 2025-03-26 11:42:52 +01:00
parent 33d7e5a7bf
commit c3c6ee5a2b
4 changed files with 58 additions and 6 deletions

View file

@ -0,0 +1,13 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
zeek_init
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
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