Skip to content

OCPBUGS-79699: rules: add rhel to label_node_openshift_io_os_id#582

Open
danielmellado wants to merge 1 commit intoopenshift:mainfrom
danielmellado:OCPBUGS-79699
Open

OCPBUGS-79699: rules: add rhel to label_node_openshift_io_os_id#582
danielmellado wants to merge 1 commit intoopenshift:mainfrom
danielmellado:OCPBUGS-79699

Conversation

@danielmellado
Copy link
Copy Markdown
Contributor

4.19+ reports label_node_openshift_io_os_id=rhel while remaining CoreOS;
the previous rhcos-only selector dropped cluster:capacity_effective_cpu_cores
from telemetry. This commit adds rhel to the rule and a test case.

Signed-off-by: Daniel Mellado dmellado@fedoraproject.org

4.19+ reports label_node_openshift_io_os_id=rhel while remaining CoreOS;
the previous rhcos-only selector dropped cluster:capacity_effective_cpu_cores
from telemetry. This commit adds rhel to the rule and a test case.

Signed-off-by: Daniel Mellado <dmellado@fedoraproject.org>
@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Mar 26, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@danielmellado: This pull request references Jira Issue OCPBUGS-79699, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

4.19+ reports label_node_openshift_io_os_id=rhel while remaining CoreOS;
the previous rhcos-only selector dropped cluster:capacity_effective_cpu_cores
from telemetry. This commit adds rhel to the rule and a test case.

Signed-off-by: Daniel Mellado dmellado@fedoraproject.org

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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: efb77479-54fd-4e63-ad2b-e2ead7ec5a3a

📥 Commits

Reviewing files that changed from the base of the PR and between d6c7dd4 and 3954e10.

📒 Files selected for processing (2)
  • jsonnet/telemeter/rules.libsonnet
  • test/rulestests.yaml

Walkthrough

The changes extend OpenShift CPU capacity monitoring to include both RHCOS and RHEL nodes. Recording rules are updated to match both OS types using regex patterns, and a test case is added to validate the new behavior for RHEL worker nodes.

Changes

Cohort / File(s) Summary
Recording Rules Update
jsonnet/telemeter/rules.libsonnet
Modified CPU capacity/cores selection logic to include both os_id="rhcos" and os_id="rhel" via regex matching. Changes affect the zeroing helper rule (cluster:cpu_capacity_cores:_id) and the main effective cores recording rule (cluster:capacity_effective_cpu_cores) across worker and control plane branches (amd64 and non-amd64).
Test Case Addition
test/rulestests.yaml
Added test case validating cluster:capacity_effective_cpu_cores behavior for RHEL nodes with _id="rhel_amd64_worker", providing input capacity of 8 and asserting effective capacity of 4.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci openshift-ci bot requested review from machine424 and raptorsun March 26, 2026 07:36
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 26, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danielmellado

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 26, 2026
@juzhao
Copy link
Copy Markdown

juzhao commented Mar 26, 2026

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Mar 26, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@juzhao: This pull request references Jira Issue OCPBUGS-79699, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

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.

record: 'cluster:cpu_capacity_cores:_id',
expr: |||
group by(_id, tenant_id) (cluster:capacity_cpu_cores:sum{label_node_openshift_io_os_id="rhcos"}) * 0
group by(_id, tenant_id) (cluster:capacity_cpu_cores:sum{label_node_openshift_io_os_id=~"rhcos|rhel"}) * 0
Copy link
Copy Markdown

@juzhao juzhao Mar 26, 2026

Choose a reason for hiding this comment

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

label_node_openshift_io_os_id=~"rhcos|rhel"} is safe
I think since 4.19+ the os id is changed to rhel now, how about leave rhel only
label_node_openshift_io_os_id="rhel"}), same for others

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review! If we stop backporting this in 4.19+ then that'd be fine. Using only label_node_openshift_io_os_id="rhel" would fix 4.19+ but would stop matching clusters still on 4.18 and earlier, where the label remains rhcos.

My main concern here is that telemeter rules run against the full fleet, so we may need both values. The regex keeps backward compatibility with the original rhcos filter and adds rhel for 4.19+, wdyt?

Copy link
Copy Markdown

@juzhao juzhao Mar 26, 2026

Choose a reason for hiding this comment

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

I see, you are right, since the telemeter server side configuration only have main branch for production, example: https://github.com/rhobs/configuration/blob/main/resources/services/rhobs-thanos-operator/staging/telemeter-rules.yaml#L149-L160, keep rhcos is right for 4.18 and below, add rhel is for 4.19+, and seems we also need to update in the rhobs for the same after this PR merged

@juzhao
Copy link
Copy Markdown

juzhao commented Mar 26, 2026

thanks, LGTM, waiting for others to review

@juzhao
Copy link
Copy Markdown

juzhao commented Mar 26, 2026

/verified by @juzhao

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Mar 26, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@juzhao: This PR has been marked as verified by @juzhao.

Details

In response to this:

/verified by @juzhao

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.

@danielmellado
Copy link
Copy Markdown
Contributor Author

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 26, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 26, 2026

@danielmellado: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants