Skip to content

Comments

Add component mapping to alerts#8

Merged
sradco merged 4 commits intomachadovilaca:add-alert-management-api-basefrom
sradco:add_alert_rule_mapping
Feb 18, 2026
Merged

Add component mapping to alerts#8
sradco merged 4 commits intomachadovilaca:add-alert-management-api-basefrom
sradco:add_alert_rule_mapping

Conversation

@sradco
Copy link
Collaborator

@sradco sradco commented Jan 5, 2026

Added a mapping of layer(cluster/namespace) and
component to alerts.

Based on openshift/enhancements#1917

@sradco sradco changed the title Add component mapping to alert rules [WIP]Add component mapping to alert rules Jan 5, 2026
@sradco sradco force-pushed the add_alert_rule_mapping branch 3 times, most recently from 8feaad6 to 20f8b4d Compare January 7, 2026 09:16
@sradco
Copy link
Collaborator Author

sradco commented Jan 11, 2026

Hi @machadovilaca , @avlitman, @simonpasquier Hi, Please review this PR.

@sradco sradco changed the title [WIP]Add component mapping to alert rules Add component mapping to alert rules Jan 12, 2026
@sradco sradco force-pushed the add_alert_rule_mapping branch from 20f8b4d to 8d7e4c6 Compare January 12, 2026 13:11
@simonpasquier
Copy link

I thought that development was supposed to happen in https://github.com/openshift/monitoring-plugin/?

@machadovilaca
Copy link
Owner

I thought that development was supposed to happen in https://github.com/openshift/monitoring-plugin/?

@simonpasquier these PRs are against the branch used for openshift#657
as long as that one is not merged to the feature branch in openshift/monitoring-plugin, we can't open PRs there

@sradco sradco force-pushed the add_alert_rule_mapping branch from 8d7e4c6 to 887f95f Compare January 15, 2026 18:52
@sradco
Copy link
Collaborator Author

sradco commented Jan 15, 2026

@machadovilaca I updated the PR based on your feedback. Please review.

@simonpasquier
Copy link

as long as that one is not merged to the feature branch in openshift/monitoring-plugin, we can't open PRs there

As it has been communicated elsewhere, we wont' be able to review a giant PR in openshift/monitoring-plugin. My expectation was that we would review PRs directly in openshift/monitoring-plugin.

@sradco
Copy link
Collaborator Author

sradco commented Jan 16, 2026

@simonpasquier once we will finish adding all the features to the branch I will split it to logical commits.

@sradco
Copy link
Collaborator Author

sradco commented Jan 19, 2026

/hold

@sradco sradco changed the title Add component mapping to alert rules Add component mapping to alerts Jan 19, 2026
@sradco sradco force-pushed the add_alert_rule_mapping branch 9 times, most recently from bddde87 to 9ac6b3a Compare January 21, 2026 15:17
@sradco
Copy link
Collaborator Author

sradco commented Jan 21, 2026

/unhold

@sradco
Copy link
Collaborator Author

sradco commented Jan 21, 2026

Hi @machadovilaca , @avlitman, Hi, Please review this PR.

@sradco sradco force-pushed the add_alert_rule_mapping branch from 8cad9bf to 8d065c3 Compare February 11, 2026 11:28
@sradco
Copy link
Collaborator Author

sradco commented Feb 11, 2026

Hi, I rebased this PR. Please review @avlitman @machadovilaca

Comment on lines +20 to +21
Component *string `json:"openshift_io_alert_rule_component,omitempty"`
ComponentSet bool `json:"-"`
Copy link
Owner

Choose a reason for hiding this comment

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

whats the difference between nil and ComponentSet false?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If ComponentSet == false: don’t change anything (leave whatever is stored today).
If ComponentSet == true and Component == nil: clear it (remove the override).
If ComponentSet == true and Component != nil: set it to that string.

Examples:

  • No change (field omitted):
    { "classification": { } }
    or omit classification entirely.
  • Clear:
    { "classification": { "openshift_io_alert_rule_component": null } }
  • Set:
    { "classification": { "openshift_io_alert_rule_component": "network" } }

@sradco sradco force-pushed the add_alert_rule_mapping branch 3 times, most recently from ba1d756 to ce4cdbf Compare February 17, 2026 13:59
Copy link
Owner

@machadovilaca machadovilaca left a comment

Choose a reason for hiding this comment

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

after fixing the current comments, looks good to me
im just not sure about the double pointers, but we can revisit later

@sradco sradco force-pushed the add_alert_rule_mapping branch 2 times, most recently from 7acd7bc to 954923d Compare February 18, 2026 15:07
sradco and others added 4 commits February 18, 2026 17:25
Document classification endpoints and implement router handlers for single and bulk updates.

Signed-off-by: Shirly Radco <sradco@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Persist classification overrides in a ConfigMap and merge effective values into alert responses.

Signed-off-by: Shirly Radco <sradco@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Add component/layer matching logic used to classify rules and alerts.

Signed-off-by: Shirly Radco <sradco@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Add k8s helpers and alert enrichment needed to compute and expose rule classification defaults.

Signed-off-by: Shirly Radco <sradco@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@sradco sradco force-pushed the add_alert_rule_mapping branch from 954923d to e0e87b1 Compare February 18, 2026 15:36
@sradco sradco merged commit e4bdd22 into machadovilaca:add-alert-management-api-base Feb 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants