GitHub alerting
The GitHub data source supports Grafana Alerting. You can create alert rules that evaluate queries against GitHub data and send notifications when conditions are met.
Before you begin
- Configure the GitHub data source.
- Familiarize yourself with alert rules and how to create a Grafana-managed alert rule.
Supported query types
Any GitHub query type that includes a time field can be used in alert rule conditions. Common use cases include:
For a complete list of query types and their time field options, refer to the query editor.
Create an alert rule
To create an alert rule using the GitHub data source:
- In the Grafana menu, click Alerting and select Alert rules.
- Click New alert rule.
- In the query section, select your GitHub data source.
- Select a Query Type and configure the query options, including a Time Field appropriate for the alert condition.
- Configure the alert condition (for example, Is above a threshold).
- Set the evaluation group and pending period.
- Configure notification settings and labels.
- Click Save rule.
For detailed step-by-step guidance, refer to Create a Grafana-managed alert rule.
Example alert rules
The following examples show common alert configurations using the GitHub data source.
Alert on failed workflow runs
Monitor a repository for failed CI/CD workflows:
- Query Type: Workflow Runs
- Owner:
your-org - Repository:
your-repo - Time Field: Created At
- Condition: Count Is above
0whereconclusionequalsfailure
Alert on open vulnerability count
Track the number of open security vulnerabilities in a repository:
- Query Type: Vulnerabilities
- Owner:
your-org - Repository:
your-repo - Condition: Count Is above the acceptable threshold
Alert on stale pull requests
Detect pull requests that have been open for an extended period:
- Query Type: Pull Requests
- Owner:
your-org - Repository:
your-repo - Query:
is:open - Time Field: Created At
- Condition: Count Is above your team’s threshold
Caching considerations
Note
The plugin caches all API responses for up to five minutes. Alert rule evaluations use cached data, so there may be a delay of up to five minutes between an event occurring in GitHub and the alert firing.
Adjust evaluation intervals and pending periods accordingly to account for this caching behavior.
Template annotations and labels
You can use template annotations and labels to include query results or metadata in alert notifications.


