-
Notifications
You must be signed in to change notification settings - Fork 912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cleanup(metrics): add original rule name as label #3205
Conversation
Signed-off-by: Melissa Kilby <[email protected]>
/milestone 0.38.0 |
@@ -182,6 +182,7 @@ std::string falco_metrics::to_text(const falco::app::state& state) | |||
rules_by_id[i]->load()); | |||
prometheus_metrics_converter.convert_metric_to_unit_convention(metric); | |||
const std::map<std::string, std::string>& const_labels = { | |||
{"rule", rule->name}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useful to preserve the original un-sanitized rule name for prometheus.
Signed-off-by: Melissa Kilby <[email protected]>
@@ -340,7 +340,7 @@ void stats_writer::collector::get_metrics_output_fields_wrapper( | |||
{ | |||
fs::path fs_path = item.first; | |||
std::string metric_name_file_sha256 = fs_path.filename().stem(); | |||
metric_name_file_sha256 = "falco.sha256_rule_file." + falco::utils::sanitize_metric_name(metric_name_file_sha256); | |||
metric_name_file_sha256 = "falco.sha256_rules_file." + falco::utils::sanitize_metric_name(metric_name_file_sha256); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We changed it to plural form elsewhere let's be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
LGTM label has been added. Git tree hash: 4d002dfe4135a418a1de9b008a1a88ed12a73e2c
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Andreagit97, FedeDP, incertum The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
Any specific area of the project related to this PR?
/area engine
What this PR does / why we need it:
cleanup(metrics): add original rule name as label
falcosecurity/charts#672 (comment) @leogr
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: