From 4deaca6ff0b54b8e455bbff66567b2257a379efd Mon Sep 17 00:00:00 2001 From: Andrea Terzolo Date: Tue, 29 Aug 2023 12:46:12 +0200 Subject: [PATCH 1/2] cleanup: fail if the time unit is not specified Signed-off-by: Andrea Terzolo --- userspace/falco/app/actions/process_events.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userspace/falco/app/actions/process_events.cpp b/userspace/falco/app/actions/process_events.cpp index b4a05ef1520..80aa6d64087 100644 --- a/userspace/falco/app/actions/process_events.cpp +++ b/userspace/falco/app/actions/process_events.cpp @@ -427,7 +427,7 @@ static falco::app::run_result init_stats_writer( if(std::all_of(config->m_metrics_interval_str.begin(), config->m_metrics_interval_str.end(), ::isdigit)) { - falco_logger::log(LOG_WARNING, "Metrics interval was passed as numeric value without Prometheus time unit, this option will be deprecated in the future"); + return falco::app::run_result::fatal("Metrics interval was passed as numeric value without Prometheus time unit. Please specify a time unit"); } if (config->m_metrics_enabled && !sw->has_output()) From 38514314d1713a7c10734b8549ac1b00715ba26f Mon Sep 17 00:00:00 2001 From: Andrea Terzolo Date: Tue, 29 Aug 2023 12:47:55 +0200 Subject: [PATCH 2/2] cleanup: turn a warning into an error Signed-off-by: Andrea Terzolo --- userspace/falco/app/actions/process_events.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userspace/falco/app/actions/process_events.cpp b/userspace/falco/app/actions/process_events.cpp index 80aa6d64087..50ac60d7c31 100644 --- a/userspace/falco/app/actions/process_events.cpp +++ b/userspace/falco/app/actions/process_events.cpp @@ -432,7 +432,7 @@ static falco::app::run_result init_stats_writer( if (config->m_metrics_enabled && !sw->has_output()) { - falco_logger::log(LOG_WARNING, "Metrics are enabled with no output configured, no snapshot will be collected"); + return falco::app::run_result::fatal("Metrics are enabled with no output configured. Please enable at least one output channel"); } falco_logger::log(LOG_INFO, "Setting metrics interval to " + config->m_metrics_interval_str + ", equivalent to " + std::to_string(config->m_metrics_interval) + " (ms)\n");