Skip to content

chore: expose more falco metrics - #3964

Draft
Molter73 wants to merge 1 commit into
masterfrom
mauro/chore/expose-more-falco-metrics
Draft

chore: expose more falco metrics#3964
Molter73 wants to merge 1 commit into
masterfrom
mauro/chore/expose-more-falco-metrics

Conversation

@Molter73

Copy link
Copy Markdown
Member

Description

This is a simple patch that exposes more internal falco metrics through our prometheus endpoint.

Checklist

  • Investigated and inspected CI test results
  • Updated documentation accordingly

Automated testing

  • Added unit tests
  • Added integration tests
  • Added regression tests

If any of these don't apply, please comment below.

Testing Performed

TODO(replace-me)
Use this space to explain how you tested your PR, or, if you didn't test it, why you did not do so. (Valid reasons include "CI is sufficient" or "No testable changes")
In addition to reviewing your code, reviewers must also review your testing instructions, and make sure they are sufficient.

For more details, ref the Confluence page about this section.

This is a simple patch that exposes more internal falco metrics through
our prometheus endpoint.
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 92920d6e-67e9-46e6-a325-524a613ccd9d

📥 Commits

Reviewing files that changed from the base of the PR and between 3ebd3cc and 33cba2c.

📒 Files selected for processing (3)
  • collector/lib/CollectorStatsExporter.cpp
  • collector/lib/system-inspector/Service.cpp
  • collector/lib/system-inspector/SystemInspector.h

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Summary

Summary by CodeRabbit

  • New Features
    • Added Prometheus metrics for process lookups, main-thread lookups, lookup duration, file-descriptor cache activity, and thread-cache activity.
    • Added visibility into cache hits, misses, lookup failures, and resource additions or removals.
    • Metrics are updated during each monitoring cycle for improved system-inspection observability.

Walkthrough

The system inspector now tracks process lookup, file-descriptor cache, and thread-cache statistics. The collector exports these values as Prometheus gauges during each polling cycle.

Changes

Statistics observability

Layer / File(s) Summary
Statistics collection
collector/lib/system-inspector/SystemInspector.h, collector/lib/system-inspector/Service.cpp
Stats now contains lookup, cache, failure, addition, removal, and duration counters. Service::GetStats populates these counters.
Prometheus gauge export
collector/lib/CollectorStatsExporter.cpp
The exporter declares gauges for the new statistics and updates them during polling.

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Low

Suggested reviewers: stringy

Merge Risk: ⚪ Minimal · up to 33cba

This change adds Falco statistics to Prometheus without altering existing behavior. No actionable merge-blocking production risk is identified.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the main change and follows the required section structure. However, the checklist remains unresolved, and the Testing Performed section still contains the TODO placeholder an… Complete or remove the checklist items as applicable. Replace the Testing Performed placeholder with the actual test steps and results, or explain why testing was not performed.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: exposing additional Falco metrics through the Prometheus endpoint.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the main change and follows the required section structure. However, the checklist remains unresolved, and the Testing Performed section still contains the TODO placeholder and template instructions.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mauro/chore/expose-more-falco-metrics

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 39 lines in your changes missing coverage. Please review.
✅ Project coverage is 27.23%. Comparing base (3ebd3cc) to head (33cba2c).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
collector/lib/CollectorStatsExporter.cpp 0.00% 26 Missing ⚠️
collector/lib/system-inspector/Service.cpp 0.00% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3964      +/-   ##
==========================================
- Coverage   27.43%   27.23%   -0.20%     
==========================================
  Files          94       94              
  Lines        5406     5445      +39     
  Branches     2535     2561      +26     
==========================================
  Hits         1483     1483              
- Misses       3198     3237      +39     
  Partials      725      725              
Flag Coverage Δ
collector-unit-tests 27.23% <0.00%> (-0.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants