From 5dd258b09a5bb2f645f5fd1d823353a6cee44079 Mon Sep 17 00:00:00 2001 From: jayanandagit <54074306+jayanandagit@users.noreply.github.com> Date: Fri, 10 Jul 2020 17:01:39 -0400 Subject: [PATCH] Cloudwatch widget queries (#362) * Bug fix: Wrong date printed when lease started and spend calculated are on the same day. * Fix data and update visualization for codebuild reset widget and error scrappers. * Fix data and update visualization for codebuild reset widget and error scrappers. * Fix data and update visualization for codebuild reset widget and error scrappers. * Fix data and update visualization for codebuild reset widget and error scrappers. * Fix data and update visualization for codebuild reset widget and error scrappers. Co-authored-by: Jaya Nanda Co-authored-by: Amudha Palani <53053396+AmudaPalani@users.noreply.github.com> --- CHANGELOG.md | 3 +++ modules/cloudwatch_dashboard.tf | 2 +- modules/fixtures/dashboards/cloudwatch_dashboard.json | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fdd938be..dd653d736 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## vNext +- Fix data and update visualization for codebuild reset widget and error scrappers. + ## v0.31.2 - Fix bug: Status change in account table fails for leased accounts that are expired. See https://github.com/Optum/dce/issues/344 - Fix bug: When lease starts today, fixed usage start and end date that was printed in log message. diff --git a/modules/cloudwatch_dashboard.tf b/modules/cloudwatch_dashboard.tf index 6ea1ece22..6c28ec793 100755 --- a/modules/cloudwatch_dashboard.tf +++ b/modules/cloudwatch_dashboard.tf @@ -14,7 +14,7 @@ locals { populate_reset_queue_name = module.populate_reset_queue.name process_reset_queue_name = module.process_reset_queue.name update_principal_policy_name = module.update_principal_policy.name - error_scraper_query = "fields @timestamp, @message | sort @timestamp desc | filter @message ~= \\\"error\\\" or @message ~= \\\"fail\\\" or @message ~= \\\"fork/exec\\\" | display @timestamp, @message, @logStream| limit 10" + error_scraper_query = "fields @timestamp, @message | sort @timestamp desc | filter @message ~= \\/(?i)error/ or @message ~= \\/(?i)failed/ or @message ~= \\/(?i)fork\\\\/exec/ | display @timestamp, @message, @logStream| limit 10" metrics_namespace_var = local.metrics_namespace account_pool_metrics_widget_period = var.account_pool_metrics_widget_period } diff --git a/modules/fixtures/dashboards/cloudwatch_dashboard.json b/modules/fixtures/dashboards/cloudwatch_dashboard.json index dce484b61..49aef1680 100644 --- a/modules/fixtures/dashboards/cloudwatch_dashboard.json +++ b/modules/fixtures/dashboards/cloudwatch_dashboard.json @@ -128,11 +128,11 @@ "width": 6, "height": 6, "properties": { - "query": "SOURCE '/aws/codebuild/${codebuild_name}' | FIELDS @message, @logStream, @timestamp\n| filter @message ~= \": # Child Account\"\n| parse @message \"*: # Child Account\" as account\n| display account, @logStream, @timestamp", + "query": "SOURCE '/aws/codebuild/${codebuild_name}' | FIELDS @message, @logStream, @timestamp\n| filter @message ~= \"Setting Account Status from NotReady to Ready\"\n| parse @message \"Setting Account Status from NotReady to Ready\" as account\n| display account, @logStream, @timestamp", "region": "${region}", "stacked": false, "view": "table", - "title": "Recent Resets" + "title": "reset accounts" } }, { @@ -140,10 +140,10 @@ "width": 6, "height": 6, "properties": { - "query": "SOURCE '/aws/codebuild/${codebuild_name}' | FIELDS @message, @logStream, @timestamp\n| filter @message ~= \": # Child Account\"\n| parse @message \"*: # Child Account\" as account\n| display account, @logStream, @timestamp\n| stats count() by account as resetNum\n| sort resetNum asc", + "query": "SOURCE '/aws/codebuild/${codebuild_name}' | FIELDS @message, @logStream, @timestamp\n| filter @message ~= \"Setting Account Status from NotReady to Ready\"\n| parse @message \"Setting Account Status from NotReady to Ready\" as account\n| display account, @logStream, @timestamp\n| stats count() as reset_count by account\n| sort reset_count asc", "region": "${region}", "stacked": false, - "title": "Most Reset Accounts", + "title": "reset accounts stats", "view": "table" } },