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

new(metrics): enable plugins metrics #3228

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

mrgian
Copy link
Contributor

@mrgian mrgian commented May 30, 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:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

new(metrics): enable plugins metrics

incertum
incertum previously approved these changes May 30, 2024
Copy link
Contributor

@incertum incertum left a comment

Choose a reason for hiding this comment

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

/approve

Bummer we could not include this for Falco 0.38.0.

@poiana
Copy link
Contributor

poiana commented May 30, 2024

LGTM label has been added.

Git tree hash: 7727207ee99834204b7925d641c637b454b07501

@incertum
Copy link
Contributor

/milestone 0.39.0

@poiana poiana added this to the 0.39.0 milestone May 30, 2024
falco.yaml Outdated Show resolved Hide resolved
@FedeDP
Copy link
Contributor

FedeDP commented Jun 3, 2024

@incertum don't we need to implement this for falco_metrics too? (ie: prometheus)?
/hold

@mrgian

@FedeDP
Copy link
Contributor

FedeDP commented Jun 3, 2024

/milestone 0.38.1

@poiana poiana modified the milestones: 0.39.0, 0.38.1 Jun 3, 2024
@incertum
Copy link
Contributor

incertum commented Jun 5, 2024

@incertum don't we need to implement this for falco_metrics too? (ie: prometheus)? /hold

@mrgian

Good call @FedeDP -- overlooked that, yes @mrgian could you add the changes to the webserver as well?

@mrgian
Copy link
Contributor Author

mrgian commented Jun 6, 2024

@incertum don't we need to implement this for falco_metrics too? (ie: prometheus)? /hold

@mrgian

Good call @FedeDP -- overlooked that, yes @mrgian could you add the changes to the webserver as well?

It shouldn't be needed since libs_metrics_collector is already initialized with the METRICS_V2_PLUGINS flag.
https://github.com/falcosecurity/falco/blob/master/userspace/falco/falco_metrics.cpp#L64

But seems like plugin-provided metrics cause a segfault when a request is made to the webserver.
The issue may lie in prometheus_metrics_converter::convert_metric_to_text_prometheus in the libs, however I'm still searching for the root cause of this.

@FedeDP @incertum

@mrgian mrgian marked this pull request as draft June 6, 2024 10:18
@mrgian mrgian force-pushed the enable-plugin-metrics branch from 8a4f977 to 4d99f03 Compare June 6, 2024 13:20
@poiana poiana removed the lgtm label Jun 6, 2024
@poiana poiana requested a review from incertum June 6, 2024 13:20
@mrgian
Copy link
Contributor Author

mrgian commented Jun 6, 2024

False alarm on the segfault! I was using an old plugin as test 🤦

As for enabling plugin metrics in the webserver, we don't need to do that since since libs_metrics_collector is already initialized with the METRICS_V2_PLUGINS flag.

We can think of changing the namespace for plugin-provided metrics to something like plugin or falco_plugin in:
https://github.com/falcosecurity/falco/blob/master/userspace/falco/falco_metrics.cpp#L227

WDYT?

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.

Left a small question: everything else sgtm!
Thanks both Melissa and Gian for this!

@leogr
Copy link
Member

leogr commented Jun 11, 2024

Left a small question: everything else sgtm! Thanks both Melissa and Gian for this!

Otherwise, SGTM too!

@mrgian mrgian force-pushed the enable-plugin-metrics branch 2 times, most recently from c8381fa to 70808e8 Compare June 12, 2024 07:43
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 Jun 12, 2024

LGTM label has been added.

Git tree hash: 93fb28e758f3a0465fa6340cbfc76924ad9a2e85

Copy link
Contributor

@incertum incertum left a comment

Choose a reason for hiding this comment

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

/approve

@incertum
Copy link
Contributor

@FedeDP CI is still not cooperating.

@FedeDP
Copy link
Contributor

FedeDP commented Jun 13, 2024

Oh of course, we need to bump libs to master too!
I will open the bump PR so that @mrgian can then rebase this one and we are good to go!

@FedeDP
Copy link
Contributor

FedeDP commented Jun 13, 2024

@mrgian can you rebase on master to fix the CI?

Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
@mrgian mrgian force-pushed the enable-plugin-metrics branch from 70808e8 to 4908fe5 Compare June 13, 2024 13:06
@poiana poiana removed the lgtm label Jun 13, 2024
@poiana poiana requested review from FedeDP and incertum June 13, 2024 13:06
@mrgian
Copy link
Contributor Author

mrgian commented Jun 13, 2024

@FedeDP Rebased :)

Copy link
Contributor

@incertum incertum 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 poiana added the lgtm label Jun 13, 2024
@poiana
Copy link
Contributor

poiana commented Jun 13, 2024

LGTM label has been added.

Git tree hash: 685f492ca5843d053268c84ba05ed50235318695

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 Jun 13, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@incertum
Copy link
Contributor

Btw @mrgian we need to update the website now ... https://falco.org/docs/metrics/falco-metrics/#plugins-metrics
CC @LucaGuerra it's gonna be interesting to explain that the plugins metrics are custom (no default ones) vs we don't truly support the other metrics for plugins atm 🙃 because of some regressions ...

@mrgian
Copy link
Contributor Author

mrgian commented Jun 13, 2024

@incertum I'm currently working on the website to document the latest plugin API features.
I'll update the page about Falco metrics too :)

@FedeDP
Copy link
Contributor

FedeDP commented Jun 13, 2024

/unhold

@poiana poiana merged commit 3e91a27 into falcosecurity:master Jun 13, 2024
33 checks passed
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