mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 12:38:20 +00:00
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:
parent
33d7e5a7bf
commit
c3c6ee5a2b
4 changed files with 58 additions and 6 deletions
|
@ -264,6 +264,11 @@ private:
|
|||
*/
|
||||
void InvokeTelemetrySyncHook();
|
||||
|
||||
/**
|
||||
* Runs the telemetry sync hooks and metric callbacks.
|
||||
*/
|
||||
void UpdateMetrics();
|
||||
|
||||
bool in_sync_hook = false;
|
||||
|
||||
std::map<std::string, std::shared_ptr<MetricFamily>> families;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue