GeezerVison is showing github.com — feat(metrics): add SensorVersion and CollectorVersion labels to cluster info metric by redhat-chai-bot · Pull Request #24035 · 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)
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 information. The sensor version is reported from cluster status, while the collector version is reported from collector health information. These details help make the versions associated with cluster metrics visible.
LazyLabels now provides sensor and collector version labels. The sensor version comes from cluster status. The collector version comes from collector health information.
Changes: Cluster version labels
| Layer / File(s) |
Summary |
Add version label getters central/metrics/custom/clusters/labels.go |
LazyLabels gains getters for the sensor version from cluster status and the collector version from collector health information. |
Estimated code review effort: 2 (Simple) | ~5 minutes
Change: Feature
Suggested reviewers: porridge
Merge Risk: Minimal · up to 0574e
-
The change adds sensor and collector version labels to the cluster info metric, and no concrete runtime risk was found. Shorten the PR title to at most 70 characters so the title check passes.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: adding SensorVersion and CollectorVersion labels to the cluster info metric. The raw summary says LazyLabels gains these two labels, sourced from ClusterStatus sensor … |
| Description check |
 |
The description fills the main Description section with a clear explanation of the change. It names the metric, the two new labels, their sources, and an example PromQL query. It also lists build and … |
| 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 main change: adding SensorVersion and CollectorVersion labels to the cluster info metric. The raw summary says LazyLabels gains these two labels, sourced from ClusterStatus sensor version and collector health info version. The title is specific, follows conventional commit form, and is one sentence. It is 83 characters, which is acceptable.
Full details: Description check
-
Explanation
The description fills the main Description section with a clear explanation of the change. It names the metric, the two new labels, their sources, and an example PromQL query. It also lists build and test results. The template's checklist sections (CHANGELOG or documentation status, production readiness or feature flag, and the automated testing checkboxes) are not ticked or marked. The author gives no explicit statement on whether a CHANGELOG entry or user documentation is needed, and the description does not say whether the new labels are GA or feature-gated. The 'How I validated' section gives build and test commands but no runtime validation of the metric output. The description also contains an 'AI-generated. Review for accuracy.' footer and a 'Chai persona' line that are not part of the template.
Resolution
Optionally tick or explain the user-facing documentation items (CHANGELOG.md and documentation PR), state whether the change is GA or behind a feature flag, and indicate which automated tests were added or modified. Consider adding a short runtime check, such as scraped metric output, to the validation section. Remove the stray 'Chai persona' line and the AI-generated footer.
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:
ce5aceb8-ebad-4c5b-9c92-272ddef3429d
Commits
-
Reviewing files that changed from the base of the PR and between 8f215a0 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; 10 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
redhat-chai-bot
changed the title
Add SensorVersion and CollectorVersion labels to cluster info metric
feat(metrics): add SensorVersion and CollectorVersion labels to cluster info metric
Nov 12, 2026
codecov
Bot
commented
Nov 12, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.87%. Comparing base (8c7ad14) to head (0574e7e).
⚠️ Report is 2 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #24035 +/- ##
==========================================
- Coverage 52.89% 52.87% -0.03%
==========================================
Files 2755 2755
Lines 175277 175277
==========================================
- Hits 92718 92673 -45
- Misses 74488 74521 +33
- Partials 8071 8083 +12
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Harness.
📢 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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
|