Skip to content
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

fix(metrics/prometheus): adopt best prometheus practices for rules counters and sha256 file metrics #3272

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

incertum
Copy link
Contributor

@incertum incertum commented Jul 3, 2024

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

/kind release

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area build

/area engine

/area tests

/area proposals

/area CI

What this PR does / why we need it:

Fixes #3271

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

fix(engine): fix metrics names to better adhere to best practices

@@ -174,7 +171,7 @@ std::string falco_metrics::to_text(const falco::app::state& state)
{
const stats_manager& rule_stats_manager = state.engine->get_rule_stats_manager();
const indexed_vector<falco_rule>& rules = state.engine->get_rules();
auto metric = libs_metrics_collector.new_metric("rules.matches_total",
auto metric = libs_metrics_collector.new_metric("rules_matches_total",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Item 3 #3271 (comment) (removing raw_name would be for the next release for sure alongside me moving the metric name sanitization to libs and I will also add a labels name sanitization method to libs).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC @Issif

@falcosecurity/falco-maintainers do we want a patch release for these minor fixes? This would allow us to create more powerful Grafana dashboards and accelerate the deprecation for the falco-exporter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a patch release with this + the centos7 EOL fix would be fine.
The only problem is the time constraint since we are nearing august and most maintainers will be off during that month!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK, also re-pushed to actually not remove the sha256 🤦‍♀️

@incertum incertum force-pushed the fix/rules-sha256-prom-metrics-naming branch 2 times, most recently from 42481da to cba712d Compare July 5, 2024 14:39
@leogr
Copy link
Member

leogr commented Jul 18, 2024

Is this planned for 0.39? Right? 🤔
/milestone 0.39.0

@poiana poiana added this to the 0.39.0 milestone Jul 18, 2024
@incertum
Copy link
Contributor Author

Is this planned for 0.39? Right? 🤔 /milestone 0.39.0

we are considering for the upcoming patch release, just so we can move forward with the new Grafana dashboards.

@FedeDP
Copy link
Contributor

FedeDP commented Jul 24, 2024

cc @Issif FYI :)

@FedeDP
Copy link
Contributor

FedeDP commented Jul 31, 2024

/milestone 0.38.2

@poiana poiana modified the milestones: 0.39.0, 0.38.2 Jul 31, 2024
…unters and sha256 file metrics

Signed-off-by: Melissa Kilby <[email protected]>
@incertum incertum force-pushed the fix/rules-sha256-prom-metrics-naming branch from cba712d to f4acc40 Compare August 2, 2024 15:27
@incertum
Copy link
Contributor Author

incertum commented Aug 2, 2024

@LucaGuerra rebased.

@Issif once merged could you re-test the metrics just to be sure it's all ok now?

@poiana
Copy link
Contributor

poiana commented Aug 2, 2024

LGTM label has been added.

Git tree hash: 457afdb7857d9f4c1774b489f8f3b24ffaa70ff1

Copy link
Contributor

@FedeDP FedeDP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@poiana
Copy link
Contributor

poiana commented Aug 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana merged commit 33a0d9c into master Aug 5, 2024
33 checks passed
@poiana poiana deleted the fix/rules-sha256-prom-metrics-naming branch August 5, 2024 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Metrics don't follow Prometheus best practices
5 participants