Skip to content

ROX-28151: Custom Prometheus metrics minimal configuration#15783

Closed
parametalol wants to merge 1 commit intomasterfrom
michael/ROX-28151-minimal-configuration
Closed

ROX-28151: Custom Prometheus metrics minimal configuration#15783
parametalol wants to merge 1 commit intomasterfrom
michael/ROX-28151-minimal-configuration

Conversation

@parametalol
Copy link
Copy Markdown
Contributor

@parametalol parametalol commented Jun 18, 2025

Description

This PR adds a new property to the private section of the central configuration storage object. It is accessible via the /v1/config API, and configurable via the System Configuration UI page.

This is the initial change to support further feature implementation in the following PRs.

Default state (empty configuration) doesn't enable any gathering.

Design document.

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 a91a09a.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.9.x-513-ga91a09ae0e.

@rhacs-bot
Copy link
Copy Markdown
Contributor

Images are ready for the commit at b434114.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.9.x-74-gb4341144d9.

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 18, 2025

Codecov Report

❌ Patch coverage is 90.00000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.08%. Comparing base (f144cf1) to head (a91a09a).
⚠️ Report is 191 commits behind head on master.

Files with missing lines Patch % Lines
central/config/service/service.go 37.50% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #15783   +/-   ##
=======================================
  Coverage   49.07%   49.08%           
=======================================
  Files        2640     2642    +2     
  Lines      195735   195747   +12     
=======================================
+ Hits        96059    96081   +22     
+ Misses      92160    92159    -1     
+ Partials     7516     7507    -9     
Flag Coverage Δ
go-unit-tests 49.08% <90.00%> (+<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 parametalol changed the title michael/ROX-28151-minimal-configuration ROX-28151: Custom Prometheus metrics minimal configuration Jun 18, 2025
@parametalol parametalol marked this pull request as ready for review June 19, 2025 07:43
@parametalol parametalol requested a review from a team as a code owner June 19, 2025 07:43
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @parametalol - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

@vikin91 vikin91 left a comment

Choose a reason for hiding this comment

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

This size of PR is definitely easier to review!

Finding scope of this PR

I have followed the business logic and identified the following flow:

  1. We add new items to the configuration and the configuration object arrives over the API
  2. We validate that object and convert it to another object (TranslateMetricLabels)
  3. If the validation fails, we reject the object provided in the API call.

This scope is limited to a single flow and easy to follow.

Observations

However, I can clearly see that there are other construct in this PR that are part of a bigger implementation, but are not necessary for the flow that this PR represents. Many things are introduced without explaining the "why" behind them (mainly the type aliases, file/pkg naming and structure). Moreover, there are many entities introduced (named with nouns) without explanation what they are doing and why they are needed (example: finding, getter, aggregator, tracker). It is hard to navigate the code when the reader does not understand what those things do.

In order to understand how those things will be composed into a feature, they must be explained when they are introduced. I would either suggest to add this to this PR, or remove all things that are not needed here.

(I checked the entire feature code and selected unit tests).

@parametalol parametalol requested a review from vikin91 July 28, 2025 08:36
@vikin91
Copy link
Copy Markdown
Contributor

vikin91 commented Aug 1, 2025

I apologize that you waited so long for my review. After a short conversation with Alex, I think it would be better if someone else would review this feature.
(Feel free to resolve any comments that may be blocking you.)

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.

Thank you for refactoring and minimalizing your previous PR. Overall I'm happy with the configuration part, but I would appreciate some more comments on WHY things are done as they are - both on the proto file, and whenever new entities or concepts are introduced.

@parametalol parametalol requested a review from stehessel August 11, 2025 14:31
@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
Copy link
Copy Markdown
Contributor Author

Merged within #15797.

@parametalol parametalol closed this Sep 8, 2025
@parametalol parametalol deleted the michael/ROX-28151-minimal-configuration 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.

5 participants