diff --git a/falco.yaml b/falco.yaml index 82cd7cc6550..2da9bd32337 100644 --- a/falco.yaml +++ b/falco.yaml @@ -695,6 +695,7 @@ webserver: # Can be an IPV4 or IPV6 address, defaults to IPV4 listen_address: 0.0.0.0 k8s_healthz_endpoint: /healthz + metrics_enabled: false ssl_enabled: false ssl_certificate: /etc/falco/falco.pem @@ -982,7 +983,6 @@ metrics: libbpf_stats_enabled: true convert_memory_to_mb: true include_empty_values: false - prometheus_enabled: false ####################################### # Falco performance tuning (advanced) # diff --git a/userspace/falco/app/actions/start_webserver.cpp b/userspace/falco/app/actions/start_webserver.cpp index f7b248454e5..76dd3f82621 100644 --- a/userspace/falco/app/actions/start_webserver.cpp +++ b/userspace/falco/app/actions/start_webserver.cpp @@ -45,7 +45,7 @@ falco::app::run_result falco::app::actions::start_webserver(falco::app::state& s + ssl_option + "\n"); std::vector metrics_collectors; - if (s.config->m_metrics_enabled && s.config->m_metrics_prometheus_enabled) + if (s.config->m_metrics_enabled && s.config->m_webserver_metrics_enabled) { for (const auto& source_info: s.source_infos) { diff --git a/userspace/falco/configuration.cpp b/userspace/falco/configuration.cpp index f94fcb987c2..008043bda2b 100644 --- a/userspace/falco/configuration.cpp +++ b/userspace/falco/configuration.cpp @@ -65,6 +65,7 @@ falco_configuration::falco_configuration(): m_webserver_listen_address("0.0.0.0"), m_webserver_k8s_healthz_endpoint("/healthz"), m_webserver_ssl_enabled(false), + m_webserver_metrics_enabled(false), m_syscall_evt_drop_threshold(.1), m_syscall_evt_drop_rate(.03333), m_syscall_evt_drop_max_burst(1), @@ -79,8 +80,7 @@ falco_configuration::falco_configuration(): m_metrics_output_file(""), m_metrics_flags((METRICS_V2_KERNEL_COUNTERS | METRICS_V2_LIBBPF_STATS | METRICS_V2_RESOURCE_UTILIZATION | METRICS_V2_STATE_COUNTERS)), m_metrics_convert_memory_to_mb(true), - m_metrics_include_empty_values(false), - m_metrics_prometheus_enabled(false) + m_metrics_include_empty_values(false) { } @@ -388,6 +388,7 @@ void falco_configuration::load_yaml(const std::string& config_name, const yaml_h { m_webserver_threadiness = falco::utils::hardware_concurrency(); } + m_webserver_metrics_enabled = config.get_scalar("webserver.metrics_enabled", false); std::list syscall_event_drop_acts; config.get_sequence(syscall_event_drop_acts, "syscall_event_drops.actions"); @@ -480,7 +481,6 @@ void falco_configuration::load_yaml(const std::string& config_name, const yaml_h m_metrics_convert_memory_to_mb = config.get_scalar("metrics.convert_memory_to_mb", true); m_metrics_include_empty_values = config.get_scalar("metrics.include_empty_values", false); - m_metrics_prometheus_enabled = config.get_scalar("metrics.prometheus_enabled", false); std::vector load_plugins; diff --git a/userspace/falco/configuration.h b/userspace/falco/configuration.h index fa241249f32..9f1e36fe604 100644 --- a/userspace/falco/configuration.h +++ b/userspace/falco/configuration.h @@ -126,6 +126,7 @@ class falco_configuration std::string m_webserver_k8s_healthz_endpoint; bool m_webserver_ssl_enabled; std::string m_webserver_ssl_certificate; + bool m_webserver_metrics_enabled; syscall_evt_drop_actions m_syscall_evt_drop_actions; double m_syscall_evt_drop_threshold; @@ -151,7 +152,6 @@ class falco_configuration uint32_t m_metrics_flags; bool m_metrics_convert_memory_to_mb; bool m_metrics_include_empty_values; - bool m_metrics_prometheus_enabled; std::vector m_plugins; // Falco engine