-
Notifications
You must be signed in to change notification settings - Fork 165
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(libsinsp): enable metrics collector on all platforms #1870
fix(libsinsp): enable metrics collector on all platforms #1870
Conversation
8b31d31
to
7b2e258
Compare
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.
I was also wondering whether we should tie available sinsp_stats_v2_collectors
to eg: MINIMAL_BUILD (for example, container-related ones will always be 0 on MINIMAL_BUILD builds).
This should be as simple as adding a compilation guard around collector entries.
@@ -274,9 +272,11 @@ class libs_metrics_collector | |||
uint32_t m_metrics_flags = METRICS_V2_KERNEL_COUNTERS | METRICS_V2_LIBBPF_STATS | METRICS_V2_RESOURCE_UTILIZATION | METRICS_V2_STATE_COUNTERS | METRICS_V2_PLUGINS; | |||
std::vector<metrics_v2> m_metrics; | |||
|
|||
#ifdef __linux__ |
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.
I think we might want to move these in the scap_platform
vtable, likely as a
struct scap_metrics_vtable
(embedded in each scap_foo_platform
), so that we could get platform-dependent metrics from the scap handle. Again, this might be an idea for a future refactor.
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.
Haven't had time to check out this PR but reading your comment @FedeDP I would like that. Especially since the scap refactor the CPU usage calculation is broken when only having a plugin source even when on Linux because we do not instantiate the agent info in that case which is used in the CPU usage calculation.
Since we don't need this for the next release, i'd put this in the |
Ei @FedeDP make sense! |
Added this as item to falcosecurity/falco#3194 (comment). |
Agree!
I think it is interesting to expose those metric for osx and win too, but yes it's not high priority. |
@mrgian hope all is well, just wanted to kindly check in and ask what our current plan is to get out of the regression in our scap platforms approach? (falcosecurity/falco#2821) If we can have a proper refactor -- amazing. Else I would also support something more intermediate to ensure the next Falco release does not have this regression anymore. CC @FedeDP @leogr Thanks in advance! |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1870 +/- ##
==========================================
- Coverage 75.19% 75.19% -0.01%
==========================================
Files 259 261 +2
Lines 33875 33875
Branches 5800 5801 +1
==========================================
- Hits 25473 25472 -1
- Misses 8402 8403 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Confirmed.
Also don't have any preference. Maybe go with what @gnosek deems slightly better, because Grzeg has been around the block for some time and I get all the callouts. The ifdefs were a good solution to get these metrics going. Now we can finally get it right. By now 4+ folks already refactored the libs metrics collector, so there is hope that we will stabilize that code at some point 🙃 . |
Any news on this @mrgian ? |
Ei @FedeDP |
Ok! Moving to next milestone then :) |
b8b3ee8
to
9938e53
Compare
9938e53
to
d0c2588
Compare
Ehi @incertum @gnosek WDYT? |
/cc @gnosek /milestone 0.20.0 |
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
d0c2588
to
ea6ddee
Compare
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: c149ce366ecba7cfa90f6c97d61d4be7ef2e6998
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FedeDP, 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 |
What type of PR is this?
Any specific area of the project related to this PR?
/area libsinsp
/area tests
Does this PR require a change in the driver versions?
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?: