mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-18 07:51:12 +00:00
cleanup(falco)!: remove outputs.rate
and outputs.max_burst
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
This commit is contained in:
@@ -25,7 +25,6 @@ limitations under the License.
|
||||
#include <unordered_map>
|
||||
|
||||
#include "falco_utils.h"
|
||||
#include "token_bucket.h"
|
||||
|
||||
#include "actions.h"
|
||||
#include "helpers.h"
|
||||
@@ -137,8 +136,6 @@ static falco::app::run_result do_inspect(
|
||||
stats_writer::collector stats_collector(statsw);
|
||||
uint64_t duration_start = 0;
|
||||
uint32_t timeouts_since_last_success_or_msg = 0;
|
||||
token_bucket rate_limiter;
|
||||
const bool rate_limiter_enabled = s.config->m_notifications_rate > 0;
|
||||
const bool is_capture_mode = source.empty();
|
||||
size_t source_engine_idx = 0;
|
||||
|
||||
@@ -156,14 +153,6 @@ static falco::app::run_result do_inspect(
|
||||
source_engine_idx = s.source_infos.at(source)->engine_idx;
|
||||
}
|
||||
|
||||
// if enabled, init rate limiter
|
||||
if (rate_limiter_enabled)
|
||||
{
|
||||
rate_limiter.init(
|
||||
s.config->m_notifications_rate,
|
||||
s.config->m_notifications_max_burst);
|
||||
}
|
||||
|
||||
// reset event counter
|
||||
num_evts = 0;
|
||||
|
||||
@@ -333,14 +322,7 @@ static falco::app::run_result do_inspect(
|
||||
{
|
||||
for(auto& rule_res : *res.get())
|
||||
{
|
||||
if (!rate_limiter_enabled || rate_limiter.claim())
|
||||
{
|
||||
s.outputs->handle_event(rule_res.evt, rule_res.rule, rule_res.source, rule_res.priority_num, rule_res.format, rule_res.tags);
|
||||
}
|
||||
else
|
||||
{
|
||||
falco_logger::log(LOG_DEBUG, "Skipping rate-limited notification for rule " + rule_res.rule + "\n");
|
||||
}
|
||||
s.outputs->handle_event(rule_res.evt, rule_res.rule, rule_res.source, rule_res.priority_num, rule_res.format, rule_res.tags);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -36,8 +36,6 @@ falco_configuration::falco_configuration():
|
||||
m_json_output(false),
|
||||
m_json_include_output_property(true),
|
||||
m_json_include_tags_property(true),
|
||||
m_notifications_rate(0),
|
||||
m_notifications_max_burst(1000),
|
||||
m_rule_matching(falco_common::rule_matching::FIRST),
|
||||
m_watch_config_files(true),
|
||||
m_buffered_outputs(false),
|
||||
@@ -264,13 +262,6 @@ void falco_configuration::load_yaml(const std::string& config_name, const yaml_h
|
||||
|
||||
m_output_timeout = config.get_scalar<uint32_t>("output_timeout", 2000);
|
||||
|
||||
m_notifications_rate = config.get_scalar<uint32_t>("outputs.rate", 0);
|
||||
if(m_notifications_rate != 0)
|
||||
{
|
||||
falco_logger::log(LOG_WARNING, "'output.rate' config is deprecated and it will be removed in Falco 0.37\n");
|
||||
}
|
||||
m_notifications_max_burst = config.get_scalar<uint32_t>("outputs.max_burst", 1000);
|
||||
|
||||
std::string rule_matching = config.get_scalar<std::string>("rule_matching", "first");
|
||||
if (!falco_common::parse_rule_matching(rule_matching, m_rule_matching))
|
||||
{
|
||||
|
@@ -65,8 +65,6 @@ public:
|
||||
bool m_json_include_tags_property;
|
||||
std::string m_log_level;
|
||||
std::vector<falco::outputs::config> m_outputs;
|
||||
uint32_t m_notifications_rate;
|
||||
uint32_t m_notifications_max_burst;
|
||||
|
||||
falco_common::priority_type m_min_priority;
|
||||
falco_common::rule_matching m_rule_matching;
|
||||
|
Reference in New Issue
Block a user