From 6ada6b0426b3c77f61078df2f92d2e9e4ff27fa2 Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Wed, 1 Feb 2023 17:19:17 +0100 Subject: [PATCH] zeek-setup: Ensure telemetry_mgr is created before other managers It's difficult to initialize metrics families in the constructor of other Managers if the telemetry_mgr isn't around yet. --- src/zeek-setup.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zeek-setup.cc b/src/zeek-setup.cc index 0b7448c256..c0cee80168 100644 --- a/src/zeek-setup.cc +++ b/src/zeek-setup.cc @@ -705,6 +705,7 @@ SetupResult setup(int argc, char** argv, Options* zopts) // policy, but we can't parse policy without DNS resolution. dns_mgr->SetDir(".state"); + telemetry_mgr = new telemetry::Manager; iosource_mgr = new iosource::Manager(); event_registry = new EventRegistry(); packet_mgr = new packet_analysis::Manager(); @@ -714,7 +715,6 @@ SetupResult setup(int argc, char** argv, Options* zopts) file_mgr = new file_analysis::Manager(); auto broker_real_time = ! options.pcap_file && ! options.deterministic_mode; broker_mgr = new Broker::Manager(broker_real_time); - telemetry_mgr = new telemetry::Manager; trigger_mgr = new trigger::Manager(); plugin_mgr->InitPreScript(); @@ -839,12 +839,12 @@ SetupResult setup(int argc, char** argv, Options* zopts) if ( reporter->Errors() > 0 ) exit(1); + telemetry_mgr->InitPostScript(); iosource_mgr->InitPostScript(); log_mgr->InitPostScript(); plugin_mgr->InitPostScript(); zeekygen_mgr->InitPostScript(); broker_mgr->InitPostScript(); - telemetry_mgr->InitPostScript(); timer_mgr->InitPostScript(); event_mgr.InitPostScript();