Skip to content

CNV-87532: router: add GET /rules endpoint - #1172

Open
sradco wants to merge 2 commits into
openshift:main-alerts-management-apifrom
sradco:alert-mgmt-restructured-07-get-rules
Open

CNV-87532: router: add GET /rules endpoint#1172
sradco wants to merge 2 commits into
openshift:main-alerts-management-apifrom
sradco:alert-mgmt-restructured-07-get-rules

Conversation

@sradco

@sradco sradco commented Aug 24, 2026

Copy link
Copy Markdown

Add GET /api/v1/alerting/rules endpoint
with Prometheus rule group retrieval,
list filtering, and label matching.

Stacks on #1171 (GET /alerts).

Signed-off-by: Shirly Radco sradco@redhat.com
Signed-off-by: João Vilaça jvilaca@redhat.com
Signed-off-by: Aviv Litman alitman@redhat.com
Co-authored-by: AI Assistant noreply@cursor.com

Made with Cursor

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 24, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 24, 2026

Copy link
Copy Markdown

@sradco: This pull request references CNV-80608 which is a valid jira issue.

Details

In response to this:

Add GET /api/v1/alerting/rules endpoint
with Prometheus rule group retrieval,
list filtering, and label matching.

Stacks on #1171 (GET /alerts).

Signed-off-by: Shirly Radco sradco@redhat.com
Signed-off-by: João Vilaça jvilaca@redhat.com
Signed-off-by: Aviv Litman alitman@redhat.com
Co-authored-by: AI Assistant noreply@cursor.com

Made with Cursor

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

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 59 minutes.

View limit details

Limit details: You’ve used the included review currently available.

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: dc6b85d8-3412-4881-b0d5-a2e275d3453f

📥 Commits

Reviewing files that changed from the base of the PR and between 05b9f60 and e2d69e3.

📒 Files selected for processing (29)
  • internal/managementrouter/alerts_get.go
  • internal/managementrouter/alerts_get_test.go
  • internal/managementrouter/query_filters.go
  • internal/managementrouter/query_filters_test.go
  • internal/managementrouter/router.go
  • internal/managementrouter/rules_get.go
  • pkg/alertcomponent/matcher.go
  • pkg/k8s/alerting_health.go
  • pkg/k8s/client.go
  • pkg/k8s/const.go
  • pkg/k8s/prometheus_alerts.go
  • pkg/k8s/prometheus_rules_types.go
  • pkg/k8s/rule_label_matchers.go
  • pkg/k8s/rule_label_matchers_test.go
  • pkg/k8s/types.go
  • pkg/management/get_alerting_health.go
  • pkg/management/get_alerts.go
  • pkg/management/get_alerts_test.go
  • pkg/management/get_rules.go
  • pkg/management/get_rules_test.go
  • pkg/management/list_rules.go
  • pkg/management/list_rules_test.go
  • pkg/management/management_suite_test.go
  • pkg/management/testutils/k8s_client_mock.go
  • pkg/management/types.go
  • pkg/management/update_classification.go
  • test/e2e/framework/framework.go
  • test/e2e/get_alerts_test.go
  • test/e2e/relabeled_rules_test.go

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

@openshift-ci
openshift-ci Bot requested review from PeterYurkovich and zhuje August 24, 2026 14:00
@openshift-ci

openshift-ci Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sradco
Once this PR has been reviewed and has the lgtm label, please assign jan--f for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@sradco sradco changed the title CNV-80608: router: add GET /rules endpoint CNV-87532: router: add GET /rules endpoint Aug 24, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 24, 2026

Copy link
Copy Markdown

@sradco: This pull request references CNV-87532 which is a valid jira issue.

Details

In response to this:

Add GET /api/v1/alerting/rules endpoint
with Prometheus rule group retrieval,
list filtering, and label matching.

Stacks on #1171 (GET /alerts).

Signed-off-by: Shirly Radco sradco@redhat.com
Signed-off-by: João Vilaça jvilaca@redhat.com
Signed-off-by: Aviv Litman alitman@redhat.com
Co-authored-by: AI Assistant noreply@cursor.com

Made with Cursor

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.

sradco and others added 2 commits August 27, 2026 14:08
Add Prometheus, Thanos, and Alertmanager
query support with GET /api/v1/alerting/
alerts endpoint including alert component
matching and alerting health status.

Signed-off-by: Shirly Radco <sradco@redhat.com>
Signed-off-by: João Vilaça <jvilaca@redhat.com>
Signed-off-by: Aviv Litman <alitman@redhat.com>
Co-authored-by: AI Assistant <noreply@cursor.com>
Add GET /api/v1/alerting/rules endpoint
with Prometheus rule group retrieval,
list filtering, and label matching.

Signed-off-by: Shirly Radco <sradco@redhat.com>
Signed-off-by: João Vilaça <jvilaca@redhat.com>
Signed-off-by: Aviv Litman <alitman@redhat.com>
Co-authored-by: AI Assistant <noreply@cursor.com>
@sradco
sradco force-pushed the alert-mgmt-restructured-07-get-rules branch from 0cf2088 to e2d69e3 Compare August 27, 2026 11:10
@openshift-ci

openshift-ci Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

@sradco: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/security e2d69e3 link false /test security

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

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants