Skip to content

alert-mgmt-06: GET /alerts endpoint#5

Open
sradco wants to merge 1 commit intoalert-mgmt-05-get-healthfrom
alert-mgmt-06-get-alerts
Open

alert-mgmt-06: GET /alerts endpoint#5
sradco wants to merge 1 commit intoalert-mgmt-05-get-healthfrom
alert-mgmt-06-get-alerts

Conversation

@sradco
Copy link
Owner

@sradco sradco commented Feb 25, 2026

Alert Management API — Part 6/14: GET /alerts endpoint

Summary

  • GET /api/v1/alerting/alerts handler with label, state, and source filtering via query parameters
  • Management-layer GetAlerts: enriches raw Prometheus alerts with rule ID and source labels by correlating against relabeled rules
  • Alert-to-rule correlation logic matching alert labels to PrometheusRule entries
  • Source derivation (platform vs user) from rule labels
  • Alerting health warnings surfaced alongside alert responses (route reachability issues)
  • Bearer token forwarding for authenticated Prometheus queries
  • Unit tests for alert enrichment, correlation, 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. → This PR — GET /alerts endpoint
    7–14. Pending — rules endpoint, create, delete, classification, platform update, bulk update, docs/CI/e2e, single-rule API

@sradco sradco force-pushed the alert-mgmt-05-get-health branch from c0d1ffd to afaf00c Compare February 25, 2026 22:35
@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-05-get-health branch from afaf00c to 6b58b59 Compare February 25, 2026 22:52
@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-05-get-health branch from 6b58b59 to ec72a13 Compare February 25, 2026 23:16
@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-05-get-health branch from ec72a13 to 719410e Compare February 25, 2026 23:57
@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-05-get-health branch from 719410e to 643f009 Compare February 26, 2026 14:41
@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-05-get-health branch from 643f009 to 8074317 Compare February 26, 2026 14:46
@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-05-get-health branch from 8074317 to ab6d08c Compare February 27, 2026 11:44
@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-05-get-health branch from ab6d08c to a137d01 Compare February 27, 2026 11:57
@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-05-get-health branch from a137d01 to 016c5f4 Compare February 27, 2026 11:59
@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-05-get-health branch from 016c5f4 to 8833735 Compare February 27, 2026 12:09
@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-05-get-health branch from 8833735 to e0aa1ff Compare February 27, 2026 13:12
@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-05-get-health branch from e0aa1ff to d92c05e Compare March 2, 2026 09:26
@sradco sradco force-pushed the alert-mgmt-06-get-alerts branch from 7cc59e9 to 3fed1cf Compare March 2, 2026 09:26
Add GET /api/v1/alerting/alerts endpoint with:
- GetAlerts management implementation: fetches alerts with state/label
  filtering, health warnings, and alert enrichment
- State and label query filter parsing
- Alert fetching via management client
- Full test coverage for both management function and HTTP handler

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-05-get-health branch from d92c05e to d700454 Compare March 2, 2026 10:04
@sradco sradco force-pushed the alert-mgmt-06-get-alerts branch from 3fed1cf to 7a20570 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