[release-4.21] OCPBUGS-96712: Apply MetricsSet relabel configs to KAS ServiceMonitor - #9294
Conversation
The KAS adaptServiceMonitor() function was missing the line that applies MetricRelabelConfigs from the configured MetricsSet (Telemetry/SRE/All). Every other component (etcd, KCM, CVO, scheduler, OAPI, OCM, routecm, NTO, OLM, catalog-operator) correctly calls its corresponding metrics.XxxRelabelConfigs(cpContext.MetricsSet), but KAS did not. This caused the KAS ServiceMonitor to always use the hardcoded Telemetry default from the YAML asset (3 metrics: apiserver_storage_objects, apiserver_request_total, apiserver_current_inflight_requests), ignoring the sre-metric-set ConfigMap entirely when METRICS_SET=SRE. The fix adds the missing call to metrics.KASRelabelConfigs() and a unit test matching the pattern used by KCM (kcm/servicemonitor_test.go).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/test e2e-kubevirt-aws-ovn-reduced AI-generated. Review for accuracy. |
|
Scheduling required tests: |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: muraee, redhat-chai-bot The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@redhat-chai-bot: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/jira refresh |
|
@wanghaoran1988: No Jira issue is referenced in the title of this pull request. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/verify bypass |
|
/verified bypass |
|
@wanghaoran1988: The DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@redhat-chai-bot: This pull request references Jira Issue OCPBUGS-96712, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/jira refresh AI-generated. Review for accuracy. |
|
@redhat-chai-bot: This pull request references Jira Issue OCPBUGS-96712, which is invalid:
Comment DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/jira refresh |
|
@wanghaoran1988: This pull request references Jira Issue OCPBUGS-96712, which is valid. 7 validation(s) were run on this bug
DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
1600118
into
openshift:release-4.21
|
@redhat-chai-bot: Jira Issue OCPBUGS-96712: Some pull requests linked via external trackers have merged: The following pull request, linked via external tracker, has not merged:
All associated pull requests must be merged or unlinked from the Jira bug in order for it to move to the next state. Once unlinked, request a bug refresh with Jira Issue OCPBUGS-96712 has not been moved to the MODIFIED state. This PR is marked as verified. If the remaining PRs listed above are marked as verified before merging, the issue will automatically be moved to VERIFIED after all of the changes from the PRs are available in an accepted nightly payload. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Backport of #8715 to release-4.21 with regenerated test fixtures.
This PR supersedes #8900, which had stale TestControlPlaneComponents fixtures causing persistent unit test failures. The cherry-pick has been rebased onto the current release-4.21 HEAD and fixtures regenerated.
Changes
Bug
Testing
go test ./control-plane-operator/controllers/hostedcontrolplane/...passesTestControlPlaneComponentsfixture comparison passesTestAdaptServiceMonitorpassesAI-generated. Review for accuracy.
@wanghaoran1988 requested in Slack thread