mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 12:38:20 +00:00
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:
parent
e118887771
commit
70872673a1
16 changed files with 260 additions and 17 deletions
|
@ -259,6 +259,13 @@ private:
|
|||
RecordValPtr GetMetricOptsRecord(const prometheus::MetricFamily& metric_family);
|
||||
void BuildClusterJson();
|
||||
|
||||
/**
|
||||
* Runs the Telemetry::sync() hook in Zeek script land.
|
||||
*/
|
||||
void InvokeTelemetrySyncHook();
|
||||
|
||||
bool in_sync_hook = false;
|
||||
|
||||
std::map<std::string, std::shared_ptr<MetricFamily>> families;
|
||||
std::map<std::string, RecordValPtr> opts_records;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue