telemetry: Invoke Telemetry::sync() only at scrape/collection time

This stops invoking Telemetry::sync() via a scheduled event and instead
only invokes it on-demand. This makes metric collection network time
independent and lazier, too.

With Prometheus scrape requests being processed on Zeek's main thread
now, we can safely invoke the script layer Telemetry::sync() hook.

Closes #3947
This commit is contained in:
Arne Welzel 2024-10-02 16:53:11 +02:00
parent e118887771
commit 70872673a1
16 changed files with 260 additions and 17 deletions

4
NEWS
View file

@ -93,6 +93,10 @@ Changed Functionality
* The ASCII input reader now suppresses warnings for consecutive invalid lines,
producing a summary of total suppressions once a valid line is encountered.
* The `Telemetry::sync()` hook is now invoked on demand. Either when the metrics
of a node are scraped via the Prometheus HTTP endpoint, or one of the collect
methods is invoked from Zeek script.
Removed Functionality
---------------------