mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Don't initialize telemetry listener at all if ZEEKCTL_CHECK_CONFIG is set
This commit is contained in:
parent
5c47533653
commit
4f0d18f45f
1 changed files with 18 additions and 21 deletions
|
@ -55,7 +55,7 @@ void Manager::InitPostScript() {
|
||||||
if ( metrics_port->Port() != 0 )
|
if ( metrics_port->Port() != 0 )
|
||||||
prometheus_url = util::fmt("%s:%u", metrics_address.data(), metrics_port->Port());
|
prometheus_url = util::fmt("%s:%u", metrics_address.data(), metrics_port->Port());
|
||||||
|
|
||||||
if ( ! prometheus_url.empty() ) {
|
if ( ! prometheus_url.empty() && ! getenv("ZEEKCTL_CHECK_CONFIG") ) {
|
||||||
CivetCallbacks* callbacks = nullptr;
|
CivetCallbacks* callbacks = nullptr;
|
||||||
auto local_node_name = id::find_val("Cluster::node")->AsStringVal();
|
auto local_node_name = id::find_val("Cluster::node")->AsStringVal();
|
||||||
if ( local_node_name->Len() > 0 ) {
|
if ( local_node_name->Len() > 0 ) {
|
||||||
|
@ -87,11 +87,9 @@ void Manager::InitPostScript() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! getenv("ZEEKCTL_CHECK_CONFIG") ) {
|
|
||||||
try {
|
try {
|
||||||
prometheus_exposer =
|
prometheus_exposer =
|
||||||
std::make_unique<prometheus::Exposer>(prometheus_url, BifConst::Telemetry::civetweb_threads,
|
std::make_unique<prometheus::Exposer>(prometheus_url, BifConst::Telemetry::civetweb_threads, callbacks);
|
||||||
callbacks);
|
|
||||||
|
|
||||||
// CivetWeb stores a copy of the callbacks, so we're safe to delete the pointer here
|
// CivetWeb stores a copy of the callbacks, so we're safe to delete the pointer here
|
||||||
delete callbacks;
|
delete callbacks;
|
||||||
|
@ -109,7 +107,6 @@ void Manager::InitPostScript() {
|
||||||
|
|
||||||
prometheus_exposer->RegisterCollectable(prometheus_registry);
|
prometheus_exposer->RegisterCollectable(prometheus_registry);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_PROCESS_STAT_METRICS
|
#ifdef HAVE_PROCESS_STAT_METRICS
|
||||||
static auto get_stats = []() -> const detail::process_stats* {
|
static auto get_stats = []() -> const detail::process_stats* {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue