/terraform-aptible-metrics

Easily provision and managed all of the resources necessary to monitor your Aptible Environments. All hosted in your Aptible account!

Primary LanguageHCL

Aptible Metrics Terraform Module

This terraform module is designed to make it simple to manage "self-hosted" metrics collection and monitoring for Aptible Environments on Aptible. It includes two submodules for managing resources:

aptible

This module is responsible for managing the Aptible resources (and the Grafana data source) necessary to collect and store container metrics.

Dependencies

This module depends on the Aptible CLI in order to set up the PostgreSQL Database to manage Grafana sessions.

grafana

This module is responsible for managing the Grafana resources necessary to visualize and monitor metrics collected by Aptible Metric Drains.

Requirements

No requirements.

Providers

No providers.

Modules

Name Source Version
aptible ./modules/aptible n/a
grafana ./modules/grafana n/a

Resources

No resources.

Inputs

Name Description Type Default Required
metrics_environment The handle of the environment to send metrics to. This can be one of the drain_environments. string n/a yes
alert_threshold The threshold at which alerts are triggered for resource utilization. Default: 0.9 (90%). number 0.9 no
alert_trigger_time The time that it takes for an alert to be triggered with the threshold is crossed. Default: 5m. string "5m" no
drain_environments The handles of the environments to drain metrics from. By default only the metrics_environment will be drained. list(string) null no
exclude_alerts If alert management should be excluded. bool false no
folder_title The title to use for the Grafana folder that will contain all of the managed resources. string "Aptible Generated" no
grafana_container_count The number of Grafana App containers to deploy. number null no
grafana_container_profile The instance profile of the Grafana App containers. string null no
grafana_container_size The size (in MB) of the Grafana App containers. number null no
grafana_db_user The user that Grafana will use to access the PostgreSQL Database. This user is created and granted the necessary permissions on the Database. string "grafana" no
grafana_endpoint_domain The custom domain for the Grafana Endpoint to use. By default the App's default domain will be used. Wildcard domains are not supported. string null no
grafana_handle The handle to use for the Grafana App. string "grafana" no
grafana_image_tag The grafana/grafana image tag (i.e. version) that the app will use. string "latest" no
influx_container_profile The instance profile of the InfluxDB metrics Database container. string null no
influx_container_size The size (in MB) of the InfluxDB metrics Database container. number null no
influx_handle The handle to use for the InfluxDB Database used to store metrics. string "influx" no
postgres_container_profile The instance profile of the PostgreSQL Grafana Database container. string null no
postgres_container_size The size (in MB) of the PostgreSQL Grafana Database container. number null no
postgres_handle The handle to use for the PostgreSQL Database used for storing Grafana data. string "pg-grafana" no

Outputs

Name Description
aptible All of the outputs from the aptible module.
grafana All of the outputs from the grafana module.

Dashboard Screenshots

App Metrics

App Dashboard

Database Metrics

Database Dashboard

Alerts

Alerts