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

Improve monitoring service controller #1688

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lburgazzoli
Copy link
Member

@lburgazzoli lburgazzoli commented Feb 24, 2025

Description

  • avoid rewriting the Prometheus config file for each reconciliation
  • add some basic unit tests

Note

requires #1689

How Has This Been Tested?

Screenshot or short clip

Merge criteria

  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

Copy link

openshift-ci bot commented Feb 24, 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

Copy link

openshift-ci bot commented Feb 24, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from lburgazzoli. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@lburgazzoli lburgazzoli force-pushed the monitoring-improvements branch 2 times, most recently from 63df2a3 to 353784f Compare February 24, 2025 18:13
@lburgazzoli lburgazzoli mentioned this pull request Feb 24, 2025
5 tasks
@lburgazzoli lburgazzoli requested a review from ykaliuta February 24, 2025 18:14
Copy link

codecov bot commented Feb 24, 2025

Codecov Report

Attention: Patch coverage is 45.56962% with 86 lines in your changes missing coverage. Please review.

Project coverage is 24.34%. Comparing base (6b2dcfc) to head (5c81f8e).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...rvices/monitoring/monitoring_controller_actions.go 44.64% 21 Missing and 10 partials ⚠️
...trollers/services/monitoring/monitoring_support.go 60.00% 10 Missing and 4 partials ⚠️
pkg/cluster/resources.go 0.00% 9 Missing ⚠️
pkg/resources/resources.go 55.00% 6 Missing and 3 partials ⚠️
...llers/services/monitoring/monitoring_controller.go 0.00% 7 Missing ⚠️
...ctions/render/kustomize/action_render_manifests.go 41.66% 6 Missing and 1 partial ⚠️
pkg/controller/types/types.go 62.50% 4 Missing and 2 partials ⚠️
pkg/utils/test/mocks/types.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1688      +/-   ##
==========================================
+ Coverage   23.60%   24.34%   +0.74%     
==========================================
  Files         171      171              
  Lines       11646    11660      +14     
==========================================
+ Hits         2749     2839      +90     
+ Misses       8622     8525      -97     
- Partials      275      296      +21     

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lburgazzoli lburgazzoli force-pushed the monitoring-improvements branch from 353784f to 09bae79 Compare February 25, 2025 09:26
@lburgazzoli lburgazzoli marked this pull request as ready for review February 25, 2025 09:26
@openshift-ci openshift-ci bot requested review from AjayJagan and lphiri February 25, 2025 09:26
s = s.Delete(rule)
case operatorv1.Managed:
ci := ch.NewCRObject(dsc)
ready, err := cluster.IsReady(ctx, cli, ci)
Copy link
Member

Choose a reason for hiding this comment

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

not about this PR, but is the old logic correct:
if component X is enabled in DSC, but it never gets ready (crashloop) then promrule will never be added. so SRE will never get alerts?

Copy link
Member Author

@lburgazzoli lburgazzoli Feb 26, 2025

Choose a reason for hiding this comment

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

correct, I think the idea was to avoid having misfired alerts when the components is being enabled for the first time, hover we do lack other mechanisms and alerts to cover the case you mentioned. Maybe we should ask SRE which could eventually could lead to a much simpler implementation.

Copy link
Contributor

Choose a reason for hiding this comment

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

to avoid having misfired alerts when the components is being enabled for the first time

And I still have the concern about unconditional deploying of scraping jobs even without the rules.

Copy link
Member

Choose a reason for hiding this comment

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

everything is bad, thats why we need to get this #1676 out, one less headache in long term 😆

- avoid rewriting the prometheus config file for each reconciliation
- add some basic unit tests
@lburgazzoli
Copy link
Member Author

/test all

@lburgazzoli
Copy link
Member Author

/test opendatahub-operator-e2e

@lburgazzoli
Copy link
Member Author

/retest

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.

4 participants