-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New relic terraform alert POC (#1409)
* starting new relic stuff * Successful terragrunt deploy of a NR alert condition * adding aert condition * adding workflow vars * fixing the missing dns files * Update terragrunt.hcl just removing an unnecessary line * Update alert_conditions.tf adding this for a test * updating secrets * updating all environments * removing uneccessary variable * atttempting to fix formatting * formatting * formatting * migrating the specific values for the new relic provider to the TF side so we can consume the TFVars while working locally. * adding back variable
- Loading branch information
Showing
14 changed files
with
148 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
resource "newrelic_nrql_alert_condition" "tf_lambda_api_errors_count_anomaly_unexpected_errors" { | ||
account_id = var.new_relic_account_id | ||
policy_id = 2801728 | ||
type = "baseline" | ||
name = "Staging - Terraform - [Lambda API] Errors count anomaly (Unexpected Errors)" | ||
enabled = true | ||
violation_time_limit_seconds = 86400 | ||
|
||
nrql { | ||
query = "SELECT count(*) FROM AwsLambdaInvocationError WHERE (`entityGuid`='MjY5MTk3NHxJTkZSQXxOQXwtNzgwNDUyNTc5NzAyODI1NTcyNw') and error.class NOT IN ('app.v2.errors:BadRequestError','jsonschema.exceptions:ValidationError', 'sqlalchemy.exc:NoResultFound', 'app.authentication.auth:AuthError', 'werkzeug.exceptions:MethodNotAllowed') and error.message NOT LIKE '{\\'result\\': \\'error\\', \\'message\\': {\\'password\\': [\\'Incorrect password\\']}}'" | ||
} | ||
|
||
critical { | ||
operator = "above" | ||
threshold = 6 | ||
threshold_duration = 300 | ||
threshold_occurrences = "all" | ||
} | ||
|
||
warning { | ||
operator = "above" | ||
threshold = 3 | ||
threshold_duration = 300 | ||
threshold_occurrences = "all" | ||
} | ||
fill_option = "none" | ||
aggregation_window = 60 | ||
aggregation_method = "event_flow" | ||
aggregation_delay = 300 | ||
baseline_direction = "upper_and_lower" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# resource "newrelic_alert_policy" "notify_terraform_policy" { | ||
# name = "Pond Example staging" | ||
# provider = newrelic | ||
# } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# data "newrelic_entity" "notification-admin-script-staging" { | ||
# name = "notification-admin-script" | ||
# provider = newrelic | ||
# domain = "BROWSER" # or BROWSER, INFRA, MOBILE, SYNTH, depending on your entity's domain | ||
# type = "APPLICATION" | ||
# } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
provider "newrelic" { | ||
account_id = var.new_relic_account_id | ||
api_key = var.new_relic_api_key | ||
region = "US" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
variable "new_relic_account_id" { | ||
type = string | ||
description = "New Relic Account ID" | ||
} | ||
variable "new_relic_api_key" { | ||
type = string | ||
description = "New Relic API Key" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
terraform { | ||
source = "../../../aws//newrelic" | ||
} | ||
|
||
include { | ||
path = find_in_parent_folders() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,4 @@ inputs = { | |
account_budget_limit = 10000 | ||
log_retention_period_days = 0 | ||
sensitive_log_retention_period_days = 7 | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters