diff --git a/CHANGES b/CHANGES index bd37e63a9d..117cb720cc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +7.0.0-dev.366 | 2024-06-06 18:06:42 -0700 + + * Check for 'zeekctl check' before trying to start up prometheus (Tim Wojtulewicz, Corelight) + 7.0.0-dev.362 | 2024-06-04 14:16:54 -0700 * Switch to zeek fork of prometheus-cpp (Tim Wojtulewicz, Corelight) diff --git a/VERSION b/VERSION index 09b0d31715..41026c21c3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.0.0-dev.362 +7.0.0-dev.366 diff --git a/src/telemetry/Manager.cc b/src/telemetry/Manager.cc index 3ad3968e7d..d8343a1a43 100644 --- a/src/telemetry/Manager.cc +++ b/src/telemetry/Manager.cc @@ -70,16 +70,18 @@ void Manager::InitPostScript() { } } - try { - prometheus_exposer = std::make_unique(prometheus_url, 2, callbacks); + if ( ! getenv("ZEEKCTL_CHECK_CONFIG") ) { + try { + prometheus_exposer = std::make_unique(prometheus_url, 2, callbacks); - // CivetWeb stores a copy of the callbacks, so we're safe to delete the pointer here - delete callbacks; - } catch ( const CivetException& exc ) { - reporter->FatalError("Failed to setup Prometheus endpoint: %s\n", exc.what()); + // CivetWeb stores a copy of the callbacks, so we're safe to delete the pointer here + delete callbacks; + } catch ( const CivetException& exc ) { + reporter->FatalError("Failed to setup Prometheus endpoint: %s\n", exc.what()); + } + + prometheus_exposer->RegisterCollectable(prometheus_registry); } - - prometheus_exposer->RegisterCollectable(prometheus_registry); } #ifdef HAVE_PROCESS_STAT_METRICS