mirror of
https://github.com/storytold/terraform-aws-observability-accelerator.git
synced 2026-10-09 00:09:43 +00:00
07545aca27
* working first run * removing core module dependencies * adding CW datasource * alarms MVP * readmes * Adding Screenshot * Adding billing note * adding billing module * Revert "adding billing module" This reverts commit 40d667e37db1036cd71a471ef2fde83ec02aaa13. reverting * adding billing module * Updating Screenshot * resolving feedback * removing unused modules * fmt * Support for tf 1.3.x * removing unused variables * support alarms for multiple workspaces * Updating Readme * amp to managed prometheus * sub-module * Fix pre-commit Co-authored-by: Rodrigue Koffi <bonclay7@users.noreply.github.com>
60 lines
1.7 KiB
Terraform
60 lines
1.7 KiB
Terraform
#CloudWatch Alerts on AMP Usage
|
|
resource "aws_cloudwatch_metric_alarm" "active_series_metrics" {
|
|
for_each = local.amp_list
|
|
alarm_name = "active-series-metrics"
|
|
comparison_operator = "GreaterThanOrEqualToThreshold"
|
|
evaluation_periods = "2"
|
|
threshold = var.active_series_threshold
|
|
alarm_description = "This metric monitors AMP active series metrics"
|
|
insufficient_data_actions = []
|
|
metric_query {
|
|
id = "m1"
|
|
return_data = true
|
|
metric {
|
|
metric_name = "ResourceCount"
|
|
namespace = "AWS/Usage"
|
|
period = "120"
|
|
stat = "Average"
|
|
unit = "None"
|
|
|
|
dimensions = {
|
|
Type = "Resource"
|
|
ResourceId = each.key
|
|
Resource = "ActiveSeries"
|
|
Service = "Prometheus"
|
|
Class = "None"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
resource "aws_cloudwatch_metric_alarm" "ingestion_rate" {
|
|
for_each = local.amp_list
|
|
alarm_name = "ingestion_rate"
|
|
comparison_operator = "GreaterThanOrEqualToThreshold"
|
|
evaluation_periods = "2"
|
|
threshold = var.ingestion_rate_threshold
|
|
alarm_description = "This metric monitors AMP ingestion rate"
|
|
insufficient_data_actions = []
|
|
metric_query {
|
|
id = "m1"
|
|
return_data = true
|
|
|
|
metric {
|
|
metric_name = "ResourceCount"
|
|
namespace = "AWS/Usage"
|
|
period = "120"
|
|
stat = "Average"
|
|
unit = "None"
|
|
|
|
dimensions = {
|
|
Type = "Resource"
|
|
ResourceId = each.key
|
|
Resource = "IngestionRate"
|
|
Service = "Prometheus"
|
|
Class = "None"
|
|
}
|
|
}
|
|
}
|
|
}
|