Collection of terraform modules to deploy the prometheus ecosystem to Cloud foundry. Prometheus collects the metrics from Cloud foundry: applications, services, cpu, memory, etc. Metrics are then persisted to InfluxDB. Metrics-based alerts can be created in prometheus and processed by alertmanager to send to Slack, email, pagerduty, etc. Finally, the metrics are available in grafana to build dashboards, help troubleshooting and create alerts. A default Cloud foundry dashboard is included.
- By default, the influxdb database service must be present (as it is on GOV.UK PaaS). If not, another backend can be used and the influxdb module disabled.
- The paas-prometheus-exporter requires a cf username and password to connect and read metrics. It is recommended to create a service account
and set it up as
SpaceAuditor
on each monitored space. - Terraform and the cloudfoundry plugin
Wrapper module abstracting all the other modules. It should be sufficient for most use cases but underlying modules can also be used directly.
Example:
module prometheus_all {
source = "git::https://github.com/DFE-Digital/cf-monitoring.git//prometheus_all"
monitoring_instance_name = "teaching-vacancies"
monitoring_org_name = "dfe"
monitoring_space_name = "teaching-vacancies-monitoring"
paas_exporter_username = var.paas_exporter_username
paas_exporter_password = var.paas_exporter_password
alertmanager_config = file("${path.module}/files/alertmanager.yml")
grafana_admin_password = var.grafana_admin_password
grafana_json_dashboards = [
file("${path.module}/dashboards/frontend.json)",
file("${path.module}/dashboards/backend.json)"
]
}
The git reference can be changed. For example for the dev
branch:
source = "git::https://github.com/DFE-Digital/cf-monitoring.git//prometheus_all?ref=dev"