mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-25 04:11:59 +00:00
refactor(metrics): use prometheus_metrics_enabled for configuration
As agreed upon during review, use this name to get started. If more backends were to be added, the configuration structure will be updated. Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
This commit is contained in:
@@ -456,7 +456,7 @@ void falco_configuration::load_yaml(const std::string& config_name)
|
||||
{
|
||||
m_webserver_config.m_threadiness = falco::utils::hardware_concurrency();
|
||||
}
|
||||
m_webserver_config.m_metrics_enabled = config.get_scalar<bool>("webserver.metrics_enabled", false);
|
||||
m_webserver_config.m_prometheus_metrics_enabled = config.get_scalar<bool>("webserver.prometheus_metrics_enabled", false);
|
||||
|
||||
std::list<std::string> syscall_event_drop_acts;
|
||||
config.get_sequence(syscall_event_drop_acts, "syscall_event_drops.actions");
|
||||
|
@@ -90,7 +90,7 @@ public:
|
||||
std::string m_k8s_healthz_endpoint = "/healthz";
|
||||
bool m_ssl_enabled = false;
|
||||
std::string m_ssl_certificate;
|
||||
bool m_metrics_enabled = false;
|
||||
bool m_prometheus_metrics_enabled = false;
|
||||
};
|
||||
|
||||
falco_configuration();
|
||||
|
@@ -65,7 +65,7 @@ void falco_webserver::start(
|
||||
res.set_content(versions_json_str, "application/json");
|
||||
});
|
||||
|
||||
if (state.config->m_metrics_enabled && webserver_config.m_metrics_enabled)
|
||||
if (state.config->m_metrics_enabled && webserver_config.m_prometheus_metrics_enabled)
|
||||
{
|
||||
m_server->Get("/metrics",
|
||||
[&state](const httplib::Request &, httplib::Response &res) {
|
||||
|
Reference in New Issue
Block a user