mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-12 21:16:33 +00:00
new(metrics): add rules_counters_enabled option
Intended to replace https://github.com/falcosecurity/falco-exporter when used with Prometheus output Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
This commit is contained in:
@@ -907,6 +907,11 @@ void falco_engine::print_stats() const
|
||||
fprintf(stdout, "%s", out.c_str());
|
||||
}
|
||||
|
||||
const stats_manager& falco_engine::get_rule_stats_manager() const
|
||||
{
|
||||
return m_rule_stats_manager;
|
||||
}
|
||||
|
||||
bool falco_engine::is_source_valid(const std::string &source) const
|
||||
{
|
||||
return m_sources.at(source) != nullptr;
|
||||
|
@@ -149,11 +149,21 @@ public:
|
||||
//
|
||||
nlohmann::json describe_rule(std::string *rule_name, const std::vector<std::shared_ptr<sinsp_plugin>>& plugins) const;
|
||||
|
||||
//
|
||||
// Return const /ref to rules stored in the Falco engine.
|
||||
//
|
||||
inline const indexed_vector<falco_rule>& get_rules() const { return m_rules; }
|
||||
|
||||
//
|
||||
// Print statistics on how many events matched each rule.
|
||||
//
|
||||
void print_stats() const;
|
||||
|
||||
//
|
||||
// Return const /ref to stats_manager to access current rules stats (how many events matched each rule so far).
|
||||
//
|
||||
const stats_manager& get_rule_stats_manager() const;
|
||||
|
||||
//
|
||||
// Set the sampling ratio, which can affect which events are
|
||||
// matched against the set of rules.
|
||||
|
@@ -63,7 +63,6 @@ public:
|
||||
const indexed_vector<falco_rule>& rules,
|
||||
std::string& out) const;
|
||||
|
||||
private:
|
||||
std::atomic<uint64_t> m_total;
|
||||
std::vector<std::unique_ptr<std::atomic<uint64_t>>> m_by_priority;
|
||||
std::vector<std::unique_ptr<std::atomic<uint64_t>>> m_by_rule_id;
|
||||
|
Reference in New Issue
Block a user