-
Notifications
You must be signed in to change notification settings - Fork 905
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(userspace/falco): fixed falco_metrics::to_text
implementation when running with plugins
#3230
Conversation
…hen running with plugins. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
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.
Right yes we knew that it was not working for plugin only since the scap regression.
Thanks @FedeDP for adding the safety checks.
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
@FedeDP do we also check for null in the output rule code? If not maybe we should add some checks in there too given we have the scap regression? |
yes @FedeDP please also adjust below code 🙏 since we will continue having the scap regression for a while.
|
/hold |
For some reason it was not failing on that locally :/ weird, but yep i add the extra checks! EDIT:
Mmmh this is outputted by the output_rule for the metrics; indeed i can confirm that both EDIT2: at a quick glance, it seems like we are using the correct inspector :/ |
Signed-off-by: Federico Di Pierro <nierro92@gmail.com> Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
they are not initialized when running Falco with plugin only, see #2821 :/ |
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
std::vector<libs::metrics::libs_metrics_collector> metrics_collectors; | ||
|
||
for (const auto& source_info: state.source_infos) | ||
for (const auto& source: state.enabled_sources) |
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.
Oh well it turns out the issue was actually here: the old code also used the syscall inspector that was not even inited i guess, and thus had NULL agent and machine infos.
That's why stats_writer was not crashing.
I think leaving the checks is ok anyway, more protection for free :)
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.
cc @incertum
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.
Ahh understood, great job spotting this and agreed more checks help here and also make it clearer that these 2 structs can be NULL in some circumstances.
/milestone 0.39.0 |
/milestone 0.38.1 |
@sgaist: changing LGTM is restricted to collaborators In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FedeDP, incertum, LucaGuerra, sgaist 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 |
/unhold |
What type of PR is this?
/kind bug
Any specific area of the project related to this PR?
/area engine
What this PR does / why we need it:
This PR does 3 things:
shared_ptr
for inspectors vector, so that we know they are kept alive whileto_text
runs and we can dereference the pointernodriver
mode with syscall source disabled, we would've tried to emit metrics for the syscall source/inspector too, but that is wrong since it is not enabled (and it would crash Falco too!)Which issue(s) this PR fixes:
Fixes #3229
Special notes for your reviewer:
Does this PR introduce a user-facing change?: