Skip to content

Commit

Permalink
Cloudwatch widget queries (#362)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Amudha Palani <[email protected]>
  • Loading branch information
3 people authored Jul 10, 2020
1 parent 9a893ed commit 5dd258b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion modules/cloudwatch_dashboard.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
8 changes: 4 additions & 4 deletions modules/fixtures/dashboards/cloudwatch_dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,22 @@
"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"
}
},
{
"type": "log",
"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"
}
},
Expand Down

0 comments on commit 5dd258b

Please sign in to comment.