Skip to content

alert-mgmt-07: GET /rules endpoint#6

Open
sradco wants to merge 1 commit intoalert-mgmt-06-get-alertsfrom
alert-mgmt-07-get-rules
Open

alert-mgmt-07: GET /rules endpoint#6
sradco wants to merge 1 commit intoalert-mgmt-06-get-alertsfrom
alert-mgmt-07-get-rules

Conversation

@sradco
Copy link
Owner

@sradco sradco commented Feb 25, 2026

Alert Management API — Part 7/14: GET /rules + ListRules

Summary

  • GET /api/v1/alerting/rules handler with label, state, matcher, and source filtering
  • Management-layer GetRules: merges Prometheus rule groups with relabeled rules, applying label overrides from AlertRelabelConfigs
  • Relabeled rule matching with PromQL expression canonicalization and duration comparison
  • ListRules: retrieves all relabeled rules with optional PrometheusRule and AlertRule filtering
  • New query types: PrometheusRuleOptions, AlertRuleOptions for flexible rule listing
  • Extended PrometheusRule type with alert-level state/active alert tracking
  • Unit tests for rule merging, relabeled matching, PromQL normalization, and handler behavior

Dependencies

This PR is part of a stacked series. Please review in order.

  1. alert-mgmt-01: k8s foundation + health stub skeleton
  2. Pending — alert listing, query & filter primitives
  3. Pending — relabel config, alerting health & AlertingRule CRD
  4. Pending — management foundation
  5. Pending — GET /health endpoint + router + server wiring
  6. Pending — GET /alerts endpoint
  7. → This PR — GET /rules + ListRules
    8–14. Pending — create, delete, classification, platform update, bulk update, docs/CI/e2e, single-rule API

@sradco sradco force-pushed the alert-mgmt-06-get-alerts branch from 40521d0 to c9ec4a8 Compare February 25, 2026 22:35
@sradco sradco force-pushed the alert-mgmt-07-get-rules branch from de14c77 to 691bfe0 Compare February 25, 2026 22:35
@sradco sradco force-pushed the alert-mgmt-06-get-alerts branch from c9ec4a8 to 15ebd83 Compare February 25, 2026 22:52
@sradco sradco force-pushed the alert-mgmt-07-get-rules branch from 691bfe0 to e53e829 Compare February 25, 2026 22:52
@sradco sradco force-pushed the alert-mgmt-06-get-alerts branch from 15ebd83 to 4df787f Compare February 25, 2026 23:16
@sradco sradco force-pushed the alert-mgmt-07-get-rules branch 3 times, most recently from 36c8fe6 to 8e38fd8 Compare February 25, 2026 23:46
@sradco sradco force-pushed the alert-mgmt-06-get-alerts branch from 4df787f to f22e335 Compare February 25, 2026 23:57
@sradco sradco force-pushed the alert-mgmt-07-get-rules branch from 8e38fd8 to e31c2f0 Compare February 25, 2026 23:57
@sradco sradco force-pushed the alert-mgmt-06-get-alerts branch from f22e335 to 207c9d0 Compare February 26, 2026 14:41
@sradco sradco force-pushed the alert-mgmt-07-get-rules branch from e31c2f0 to b612d80 Compare February 26, 2026 14:41
@sradco sradco force-pushed the alert-mgmt-06-get-alerts branch from 207c9d0 to ef07a74 Compare February 26, 2026 14:46
@sradco sradco force-pushed the alert-mgmt-07-get-rules branch from b612d80 to 2236058 Compare February 26, 2026 14:47
@sradco sradco force-pushed the alert-mgmt-06-get-alerts branch from ef07a74 to 0e8d580 Compare February 27, 2026 11:44
@sradco sradco force-pushed the alert-mgmt-07-get-rules branch from 2236058 to 99b1d22 Compare February 27, 2026 11:44
@sradco sradco force-pushed the alert-mgmt-06-get-alerts branch from 0e8d580 to 7096227 Compare February 27, 2026 11:57
@sradco sradco force-pushed the alert-mgmt-07-get-rules branch from 99b1d22 to 3214560 Compare February 27, 2026 11:57
@sradco sradco force-pushed the alert-mgmt-06-get-alerts branch from 7096227 to 54c6286 Compare February 27, 2026 11:59
@sradco sradco force-pushed the alert-mgmt-07-get-rules branch from 3214560 to 9dafb1b Compare February 27, 2026 11:59
@sradco sradco force-pushed the alert-mgmt-06-get-alerts branch from 54c6286 to fdf5bf9 Compare February 27, 2026 12:09
@sradco sradco force-pushed the alert-mgmt-07-get-rules branch from 9dafb1b to 23606c7 Compare February 27, 2026 12:10
@sradco sradco force-pushed the alert-mgmt-06-get-alerts branch from fdf5bf9 to 7cc59e9 Compare February 27, 2026 13:12
@sradco sradco force-pushed the alert-mgmt-07-get-rules branch 2 times, most recently from 8595634 to c4f658e Compare March 2, 2026 09:26
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-06-get-alerts branch from 3fed1cf to 7a20570 Compare March 2, 2026 10:04
@sradco sradco force-pushed the alert-mgmt-07-get-rules branch from c4f658e to 2eb0d27 Compare March 2, 2026 10:04
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.

1 participant