Skip to content

ROX-28151: Custom Prometheus metrics minimal aggregator#15784

Closed
parametalol wants to merge 1 commit intomichael/ROX-28151-minimal-configurationfrom
michael/ROX-28151-minimal-aggregator
Closed

ROX-28151: Custom Prometheus metrics minimal aggregator#15784
parametalol wants to merge 1 commit intomichael/ROX-28151-minimal-configurationfrom
michael/ROX-28151-minimal-aggregator

Conversation

@parametalol
Copy link
Copy Markdown
Contributor

@parametalol parametalol commented Jun 18, 2025

Description

The PR introduces the data aggregation logic to support custom Prometheus metrics.

Every piece of source data sent for aggregation is called a finding. The aggregation process builds an aggregation key, which serves as the key for the aggregated numbers map.

For example, the keys for a single "Severity" label will be 4 known severity levels (LOW to CRITICAL), the aggregation map will have a key for each severity, and the number of findings as the value.
For multiple labels, the key is a joined value of all labels.

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

Unit tests.

Current dependencies on/for this PR:

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Jun 18, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@rhacs-bot
Copy link
Copy Markdown
Contributor

rhacs-bot commented Jun 18, 2025

Images are ready for the commit at 30cee42.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.9.x-514-g30cee423f9.

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 18, 2025

Codecov Report

❌ Patch coverage is 93.33333% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.09%. Comparing base (a91a09a) to head (30cee42).

Files with missing lines Patch % Lines
central/metrics/custom/tracker/aggregator.go 91.17% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@                             Coverage Diff                             @@
##           michael/ROX-28151-minimal-configuration   #15784      +/-   ##
===========================================================================
+ Coverage                                    49.08%   49.09%   +0.01%     
===========================================================================
  Files                                         2642     2644       +2     
  Lines                                       195747   195830      +83     
===========================================================================
+ Hits                                         96081    96151      +70     
- Misses                                       92159    92163       +4     
- Partials                                      7507     7516       +9     
Flag Coverage Δ
go-unit-tests 49.09% <93.33%> (+0.01%) ⬆️

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

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@parametalol
Copy link
Copy Markdown
Contributor Author

/retest

Copy link
Copy Markdown
Collaborator

@stehessel stehessel left a comment

Choose a reason for hiding this comment

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

The code looks correct to me, but I think even more examples would go a long way here to take away some of the abstraction and complexity introduced by the custom types.

@parametalol parametalol requested a review from stehessel August 13, 2025 14:33
@parametalol parametalol force-pushed the michael/ROX-28151-minimal-aggregator branch from 30d5b00 to 7df7ad8 Compare August 14, 2025 11:51
@parametalol parametalol requested a review from a team as a code owner August 14, 2025 11:51
@parametalol parametalol requested review from vladbologa and removed request for a team August 14, 2025 11:51
@parametalol parametalol force-pushed the michael/ROX-28151-minimal-configuration branch from 841e4a0 to 25f4739 Compare August 14, 2025 11:52
@parametalol parametalol force-pushed the michael/ROX-28151-minimal-configuration branch from 25f4739 to a91a09a Compare August 18, 2025 09:58
@parametalol parametalol force-pushed the michael/ROX-28151-minimal-aggregator branch from 7df7ad8 to 30cee42 Compare August 18, 2025 09:58
@parametalol
Copy link
Copy Markdown
Contributor Author

Merged within #15797.

@parametalol parametalol closed this Sep 8, 2025
@parametalol parametalol deleted the michael/ROX-28151-minimal-aggregator branch September 16, 2025 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants