Skip to content

Commit

Permalink
docs: Add motivation and example usage to README
Browse files Browse the repository at this point in the history
  • Loading branch information
mkilchhofer committed Aug 21, 2024
1 parent ef3ef86 commit 0a0091e
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# terraform-grafana-prometheus-alerts
Terraform module to convert Prometheus alert rules to Grafana alerts

Terraform module to convert [Prometheus Alerting rules] to Grafana-managed alerts

## Motivation / Why using this module

There are plenty of apps (mostly out of CNCF's ecosystem) where the vendor or the community provides monitoring dashboards
and alerts. Dashboards are normally provided as a JSON file which can be loaded into Grafana. Alerts are mostly provided
as [Prometheus Alerting rules].

There are users who already operate a Grafana instance or use a managed Grafana instance from a cloud provider (Grafana
Cloud, Amazon Managed Grafana, Azure Managed Grafana, etc.). Why not using this Grafana instance for the
alerting?

The problem is that Grafana's unified alerting uses another format for the alert definition but the concept with labels,
annotations (provide description and runbook URLs) is almost identical.
This module allows you to reuse the [Prometheus Alerting rules] and configure them inside Grafana.

## Example usage

```hcl
module "cert_manager_rules" {
source = "github.com/mkilchhofer/terraform-grafana-prometheus-alerts"
prometheus_alerts_file_path = file("/path/to/alerts/cert-manager.yaml")
folder_uid = grafana_folder.test.uid
datasource_uid = grafana_data_source.victoria_metrics.uid
}
```

## Requirements

Expand Down Expand Up @@ -41,3 +68,5 @@ TODO
| alertsfile\_map | n/a |
| file\_as\_yaml | n/a |
<!-- END_TF_DOCS -->

[Prometheus Alerting rules]: https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/

0 comments on commit 0a0091e

Please sign in to comment.