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

feat(userspace)!: deprecate stats command args option in favor of metrics configs in falco.yaml #2739

Merged
merged 4 commits into from
Aug 25, 2023

Conversation

incertum
Copy link
Contributor

@incertum incertum commented Aug 23, 2023

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:

As scheduled deprecate stats command args option in favor of metrics configs in falco.yaml for Falco 0.36 release.

@jasondellaluce

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

feat(userspace)!: deprecate stats command args option in favor of metrics configs in falco.yaml

@github-actions
Copy link

This PR may bring feature or behavior changes in the Falco engine and may require the engine version to be bumped.

Please double check userspace/engine/falco_engine_version.h file. See versioning for FALCO_ENGINE_VERSION.

/hold

@@ -613,7 +613,7 @@ syscall_event_drops:
max_burst: 1
simulate_drops: false

# [Experimental] `metrics`
# [Stable] `metrics`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@FedeDP @leogr WDYT? Other than that one odd behavior where the timer did not work when using http output (which Federico fixed) I have not heard of more issues when using the metrics feature, have you? It is working well for me in production.

Proposing to bump to Stable, which does not mean that there may be no additional bugs, it rather signals we are supporting metrics now as stable feature going forward.

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 this is good 2 go! Agree with you.
@leogr more thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

Agree 👍

cc @falcosecurity/falco-maintainers for visibility

@incertum
Copy link
Contributor Author

/milestone 0.36.0

@poiana poiana added this to the 0.36.0 milestone Aug 23, 2023
Copy link
Member

@leogr leogr left a comment

Choose a reason for hiding this comment

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

SGTM. I am just waiting for more opinions before giving my approval.

@@ -613,7 +613,7 @@ syscall_event_drops:
max_burst: 1
simulate_drops: false

# [Experimental] `metrics`
# [Stable] `metrics`
Copy link
Member

Choose a reason for hiding this comment

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

Agree 👍

cc @falcosecurity/falco-maintainers for visibility

}
}
}
// Keep for future use cases.
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@Andreagit97 Andreagit97 left a comment

Choose a reason for hiding this comment

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

Just one minor cleanup otherwise LGTM!
Talking with Fede, he correctly pointed out that removing -s would break all current Falco settings that are running with this flag enabled by default, but in the end, we depracted it in Falco 0.35 so it should be fine

@@ -219,8 +219,6 @@ void options::define(cxxopts::Options& opts)
("p,print", "Add additional information to each falco notification's output.\nWith -pc or -pcontainer will use a container-friendly format.\nWith -pk or -pkubernetes will use a kubernetes-friendly format.\nAdditionally, specifying -pc/-pk will change the interpretation of %container.info in rule output fields.", cxxopts::value(print_additional), "<output_format>")
("P,pidfile", "When run as a daemon, write pid to specified file", cxxopts::value(pidfilename)->default_value("/var/run/falco.pid"), "<pid_file>")
("r", "Rules file/directory (defaults to value set in configuration file, or /etc/falco_rules.yaml). This option can be passed multiple times to read from multiple files/directories.", cxxopts::value<std::vector<std::string>>(), "<rules_file>")
("s", "If specified, append statistics related to Falco's reading/processing of events to this file (only useful in live mode).", cxxopts::value(stats_output_file), "<stats_file>")
Copy link
Member

Choose a reason for hiding this comment

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

we need to remove also stats_output_file and stats_interval variables

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you! Also rebased since we adjusted the build setup a bit.

incertum and others added 4 commits August 24, 2023 16:48
…ics configs in falco.yaml

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Co-authored-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
Copy link
Member

@Andreagit97 Andreagit97 left a comment

Choose a reason for hiding this comment

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

/approve
Thanks

@poiana
Copy link
Contributor

poiana commented Aug 25, 2023

LGTM label has been added.

Git tree hash: 98c70c66d4c2b0a9c065f10703b08f56f5d4767b

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

@FedeDP
Copy link
Contributor

FedeDP commented Aug 25, 2023

Per #2739 (comment), do we need an engine bump?

@Andreagit97
Copy link
Member

/hold

@Andreagit97
Copy link
Member

Per #2739 (comment), do we need an engine bump?

uhm the message was printed because this PR touches a file under /userspace/engine/* but not sure we need an engine version bump in the end the logic is almost the same we removed a fallback check 🤔 cc @leogr

@@ -435,7 +435,6 @@ static falco::app::run_result init_stats_writer(
falco_logger::log(LOG_WARNING, "Metrics are enabled with no output configured, no snapshot will be collected");
}

Copy link
Member

Choose a reason for hiding this comment

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

I cannot comment on the right line but above (https://github.com/falcosecurity/falco/pull/2739/files#diff-3a3a5ebb7d4bf516a4c732cadcd83feabe05a5cc76a9ca9e1f55802a94b3c4a7R428), there is a check on the prometheus stats format that say

falco_logger::log(LOG_WARNING, "Metrics interval was passed as numeric value without Prometheus time unit, this option will be deprecated in the future");

Probably we want to turn it into an falco::app::run_result::fatal , WDYT?
It could be a future cleanup if we want merge this :)

@@ -435,7 +435,6 @@ static falco::app::run_result init_stats_writer(
falco_logger::log(LOG_WARNING, "Metrics are enabled with no output configured, no snapshot will be collected");
Copy link
Member

Choose a reason for hiding this comment

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

Moreover, this is a misconfiguration of the tool an IMO we should fail, WDYT?
Not related to this PR but just a consideration

@leogr
Copy link
Member

leogr commented Aug 25, 2023

Per #2739 (comment), do we need an engine bump?

uhm the message was printed because this PR touches a file under /userspace/engine/* but not sure we need an engine version bump in the end the logic is almost the same we removed a fallback check 🤔 cc @leogr

Correct, it was a false positive. We can merge this without bumping the engine version.
cc @jasondellaluce

Copy link
Member

@leogr leogr left a comment

Choose a reason for hiding this comment

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

/hold cancel

@poiana
Copy link
Contributor

poiana commented Aug 25, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, FedeDP, incertum, leogr

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:
  • OWNERS [Andreagit97,FedeDP,incertum,leogr]

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 b66bf2c into falcosecurity:master Aug 25, 2023
17 checks passed
@Andreagit97 Andreagit97 changed the title feat(userspace): deprecate stats command args option in favor of metrics configs in falco.yaml feat(userspace)!: deprecate stats command args option in favor of metrics configs in falco.yaml Sep 26, 2023
@incertum incertum deleted the deprecate-old-stats-flags branch March 5, 2024 22:22
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.

5 participants