GeezerVison is showing github.com — feat(metrics): add SensorVersion and CollectorVersion labels to cluster info metric by redhat-chai-bot · Pull Request #24036 · stackrox/stackrox
Conversation
Summary
Enrich the existing rox_central_health_cluster_info Prometheus metric with SensorVersion and CollectorVersion labels so that operators can monitor what versions their connected secured clusters are running.
Details
The rox_central_health_cluster_info gauge metric currently exposes Cluster (name), Type, and Status (health) labels. While sensor and collector version information is tracked internally in ClusterStatus, it is not surfaced in the metric.
This change adds two new label getters to central/metrics/custom/clusters/labels.go:
- SensorVersion — reports the sensor version from
ClusterStatus.SensorVersion
- CollectorVersion — reports the collector version from
CollectorHealthInfo.Version
This enables queries like:
rox_central_health_cluster_info{SensorVersion!="4.7.0"}
to quickly identify clusters running outdated versions.
Testing
go build ./central/metrics/custom/clusters/... passes
go test ./central/metrics/custom/... passes (all sibling packages including tracker)
Supersedes #24035 (reopened from upstream branch to fix fork-related CI failures).
AI-generated. Review for accuracy.
@johannes94 requested from Slack
Chai persona: ACS SIGs
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 12, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
No actionable comments were generated in the recent review.
Summary
-
Summary by CodeRabbit
- New Features
- Cluster metrics now include sensor and collector version labels.
LazyLabels adds SensorVersion and CollectorVersion labels. It reads their values from cluster status and collector health info.
Changes: Cluster version labels
| Layer / File(s) |
Summary |
Add version labels central/metrics/custom/clusters/labels.go |
LazyLabels adds getters for SensorVersion and CollectorVersion. The getters read from cluster status and collector health info. |
Estimated code review effort: 1 (Trivial) | ~3 minutes
Change: Feature
Suggested reviewers: porridge
Merge Risk: Minimal · up to 0574e
-
The cluster info metric gains sensor and collector version labels. No concrete runtime risk was found. The PR title exceeds the 70-character limit and should be shortened for the title check to pass.
Pre-merge checks: 3 · 1
-
Failed checks: 1 inconclusive
| Check name |
Status |
Explanation |
Resolution |
| Description check |
 |
The description covers the core content. It explains the motivation, names the two new label getters and their sources (ClusterStatus.SensorVersion and CollectorHealthInfo.Version), gives a query exam… |
Complete the template sections. Replace the 'change me!' placeholder in the Description section, or remove that section if the title is considered sufficient. State whether CHANGELOG.md is updated or not needed, and whether a documentation … |
Passed checks: 3 passed
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the change accurately. The PR adds SensorVersion and CollectorVersion labels to the rox_central_health_cluster_info metric, and the raw summary confirms LazyLabels in labels.go adds th… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title names the change accurately. The PR adds SensorVersion and CollectorVersion labels to the rox_central_health_cluster_info metric, and the raw summary confirms LazyLabels in labels.go adds these two labels. The title is concise, follows a conventional commit style, and a teammate scanning history would understand the main change. It is 83 characters, which is acceptable.
Full details: Description check
-
Explanation
The description covers the core content. It explains the motivation, names the two new label getters and their sources (ClusterStatus.SensorVersion and CollectorHealthInfo.Version), gives a query example, and lists build and test results. It does not follow the repository template closely. The template's User-facing documentation checklist (CHANGELOG.md, documentation PR) and Testing and quality checklist (production readiness or feature flag, CI inspection) are missing. The Automated testing checklist is unchecked and the 'change me!' placeholder text remains in the template sections. The description also says the PR supersedes #24035 for fork-related CI failures, which is process detail rather than change detail. The 'How I validated' section lists commands but not a runtime check of the metric output.
Resolution
Complete the template sections. Replace the 'change me!' placeholder in the Description section, or remove that section if the title is considered sufficient. State whether CHANGELOG.md is updated or not needed, and whether a documentation PR is needed. Answer the production-readiness item: confirm the change is GA or gate it behind a feature flag. Check the CI results item. Mark which automated tests were added or modified, or explain why none were added. Replace the 'change me!' placeholder in the How I validated section with a short description of the manual or runtime validation, such as a curl or Prometheus query against the metric.
Recent review info
-
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Central YAML (base), Organization UI (inherited)
- Review profile: CHILL
- Plan: Enterprise
- Run ID:
e1e02a90-7aa0-4bae-9734-d1f2682a2332
Commits
-
Reviewing files that changed from the base of the PR and between 1f287d0 and 0574e7e.
Files selected for processing: 1
-
central/metrics/custom/clusters/labels.go
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
🚀 Build Images Ready
Images are ready for commit 0574e7e. To use with deploy scripts:
export MAIN_IMAGE_TAG=5.1.x-567-g0574e7eb60
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
1 similar comment
🚀 Build Images Ready
Images are ready for commit 0574e7e. To use with deploy scripts:
export MAIN_IMAGE_TAG=5.1.x-567-g0574e7eb60
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|