Skip to content

Alert Rule Validation #227

@jamesc-grafana

Description

@jamesc-grafana

Story (Outcome/Output) (Required)

As part of the integrator and query testing, we should validate the structure of the provisioned alert rule. This will enable us to identify issues where the alert rule will not work. This is slightly more in-depth than the current query testing as we're also looking to test the expressions.

In addition to retrieving the number of log lines that match the query, we will additionally be able to tell the user whether in the current state of the system the alert will fire, and, if any, parts of the rule that are not able to be evaluated by GMA.

Context

Grafana Managed Alerting provides an endpoint /api/v1/eval which is used when you manually create an alert to "Preview" the alert. This enables a user to see the results of each of the parts of the alerts.

Definition of Done (Required)

  • Integrator updated to use /api/v1/eval to validate that the query is valid

Implementation Plan

Document how we plan to implement this issue, to the level of depth required for the ticket. Very basic tickets will have nothing here, while complex epics will have a significant amount that branch into many subtasks. Use this to plan your implementation. If relevant, note any alternatives you considered and quickly why you chose your solution.

Testing Plan

How we plan to test the ticket (if applicable). Unit tests & integration tests are assumed, but details on them can be added if significant. Descriptions of how to validate the change and what automated end-to-end testing to add should be included.

Dependencies (Required)

What teams, systems, etc do we depend on? What other tickets do we have? What poses a risk to completing this in the capacity we estimated?

Metadata

Metadata

Labels

integratorIssues related to the integration of queriesquery-testingRelated to testing the queries and alert rules

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions