-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b3a395
commit 8a9bb7d
Showing
12 changed files
with
173 additions
and
105 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
20 changes: 11 additions & 9 deletions
20
tf-managed/modules/daily-snapshot/monitoring/event_rules.tf
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 |
---|---|---|
@@ -1,26 +1,28 @@ | ||
# This file constains NR event rules used to generate metrics from logs, given that | ||
# the service is not generating metrics by itself. | ||
resource "newrelic_events_to_metrics_rule" "generate_snapshot_attempt_metrics" { | ||
account_id = var.new_relic_account_id | ||
for_each = toset(["mainnet", "calibnet"]) | ||
for_each = toset(["mainnet", "calibnet"]) | ||
|
||
name = format("%s %s snapshot generation attempts", var.service_name, each.key) | ||
name = format("%s %s snapshot generation attempts", var.service_name, each.key) | ||
description = "Snapshot generation attempts" | ||
nrql = "From Log select uniqueCount(message) as '${var.service_name}.${each.key}.snapshot_generation_run' WHERE `hostname` = '${var.service_name}' AND filePath ='/root/logs/${each.key}_log.txt' AND message LIKE '%running snapshot export%'" | ||
nrql = "From Log select uniqueCount(message) as '${var.service_name}.${each.key}.snapshot_generation_run' WHERE `hostname` = '${var.service_name}' AND filePath ='/root/logs/${each.key}_log.txt' AND message LIKE '%running snapshot export%'" | ||
} | ||
|
||
resource "newrelic_events_to_metrics_rule" "generate_snapshot_success_metrics" { | ||
account_id = var.new_relic_account_id | ||
for_each = toset(["mainnet", "calibnet"]) | ||
for_each = toset(["mainnet", "calibnet"]) | ||
|
||
name = format("%s %s snapshot generation success", var.service_name, each.key) | ||
name = format("%s %s snapshot generation success", var.service_name, each.key) | ||
description = "Success snapshot generations" | ||
nrql = "From Log select uniqueCount(message) as '${var.service_name}.${each.key}.snapshot_generation_ok' WHERE `hostname` = '${var.service_name}' AND filePath ='/root/logs/${each.key}_log.txt' AND message LIKE '%Snapshot uploaded for%'" | ||
nrql = "From Log select uniqueCount(message) as '${var.service_name}.${each.key}.snapshot_generation_ok' WHERE `hostname` = '${var.service_name}' AND filePath ='/root/logs/${each.key}_log.txt' AND message LIKE '%Snapshot uploaded for%'" | ||
} | ||
|
||
resource "newrelic_events_to_metrics_rule" "generate_snapshot_fail_metrics" { | ||
account_id = var.new_relic_account_id | ||
for_each = toset(["mainnet", "calibnet"]) | ||
for_each = toset(["mainnet", "calibnet"]) | ||
|
||
name = format("%s %s snapshot generation failure", var.service_name, each.key) | ||
name = format("%s %s snapshot generation failure", var.service_name, each.key) | ||
description = "Failed snapshot generations" | ||
nrql = "From Log select uniqueCount(message) as '${var.service_name}.${each.key}.snapshot_generation_fail' WHERE `hostname` = '${var.service_name}' AND filePath ='/root/logs/${each.key}_log.txt' AND message LIKE '%Snapshot upload failed for%'" | ||
nrql = "From Log select uniqueCount(message) as '${var.service_name}.${each.key}.snapshot_generation_fail' WHERE `hostname` = '${var.service_name}' AND filePath ='/root/logs/${each.key}_log.txt' AND message LIKE '%Snapshot upload failed for%'" | ||
} |
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
Oops, something went wrong.