-
Notifications
You must be signed in to change notification settings - Fork 190
controller: add object_namespace label to bad configs metric #1671
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
base: master
Are you sure you want to change the base?
Conversation
This commit adds object_namespace label to the metrics: * operator_alertmanager_bad_objects_count * operator_vmalert_bad_objects_count It helps to route alerts on object_namespace label.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds the object_namespace label to metrics tracking bad/broken configuration objects in the operator, enabling alerts to be routed based on the namespace where broken configurations exist.
- Converts two counter metrics from simple counters to counter vectors with
object_namespacelabel - Updates metric collection logic to group and count broken configs per namespace
- Documents the feature addition in the CHANGELOG
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
internal/controller/operator/factory/vmalertmanager/alertmanager.go |
Converts operator_alertmanager_bad_objects_count from Counter to CounterVec with object_namespace label |
internal/controller/operator/factory/vmalertmanager/statefulset.go |
Updates metric collection to group broken AlertmanagerConfigs by namespace and emit per-namespace counts |
internal/controller/operator/factory/vmalert/rules.go |
Converts operator_vmalert_bad_objects_count from Counter to CounterVec with object_namespace label and updates collection logic |
docs/CHANGELOG.md |
Documents the new object_namespace label feature for both metrics |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Do we have the same for VMagent child objects? |
There is no such metrics for vmagent and vmauth objects. Probably, we could add it. Can you please create an issue for that? |
|
And what do you think about moving parent component name to labels and change metric name to operator_bad_objects_count? |
Signed-off-by: f41gh7 <nik@victoriametrics.com>
| Name: "operator_vmalert_bad_objects_count", | ||
| Help: "Number of incorrect objects by controller", | ||
| ConstLabels: prometheus.Labels{ | ||
| "controller": "vmrules", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
controller can be either vmrules or vmalerts, it's not static
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please check PR #1676
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it's better to remove controller label.
This commit adds object_namespace label to the metrics:
It helps to route alerts on object_namespace label.