-
Notifications
You must be signed in to change notification settings - Fork 2
Setup AWS CloudWatch
-
Go to AWS CloudWatch, and select "Dashboards". In the main screen, select "Create dashboard". In the popup window, let's call it "FAM-Ops" and then click "Create dashboard"
-
In the dashboard space, click on "Actions" and then select "View/edit source"
-
In the pop up window, paste the following config template, and we need to change a few parameters so that it matches the service in our current AWS environment
- fam api lambda name
- fam auth lambda name
- fam api gateway name
- rds cluster name
{ "widgets": [ { "height": 5, "width": 8, "y": 5, "x": 0, "type": "metric", "properties": { "metrics": [ [ "AWS/ApiGateway", "4XXError", "ApiName", "fam-api-lambda-credible-lamprey-gateway", "Stage", "v1", { "visible": false } ], [".", "5XXError", ".", ".", ".", "."] ], "view": "timeSeries", "stacked": false, "region": "ca-central-1", "title": "API Gateway 5XX Errors", "period": 300, "stat": "Sum" } }, { "height": 5, "width": 8, "y": 10, "x": 0, "type": "metric", "properties": { "metrics": [ [ "AWS/ApiGateway", "4XXError", "ApiName", "fam-api-lambda-glad-spaniel-gateway", "Stage", "v1" ] ], "view": "timeSeries", "stacked": false, "region": "ca-central-1", "title": "API Gateway 4XX Errors", "period": 300, "stat": "Sum" } }, { "height": 5, "width": 8, "y": 0, "x": 0, "type": "metric", "properties": { "metrics": [ [ "AWS/Lambda", "Errors", "FunctionName", "fam-api-lambda-glad-spaniel", { "label": "API Lambda Errors" } ], [ "...", "fam-auth-lambda-climbing-snapper", { "label": "Auth Lambda Errors" } ] ], "view": "timeSeries", "stacked": false, "region": "ca-central-1", "period": 300, "stat": "Sum", "title": "Lambda Errors" } }, { "height": 5, "width": 8, "y": 0, "x": 8, "type": "metric", "properties": { "metrics": [ [ "AWS/ApiGateway", "Latency", "ApiName", "fam-api-lambda-glad-spaniel-gateway", "Stage", "v1", { "label": "p99", "stat": "p99" } ], ["...", { "label": "p95" }], ["...", { "label": "p90", "stat": "p90" }], ["...", { "stat": "p50", "label": "p50" }] ], "view": "timeSeries", "stacked": false, "region": "ca-central-1", "title": "API Gateway Performance (Latency)", "period": 300, "stat": "p95" } }, { "height": 5, "width": 8, "y": 5, "x": 16, "type": "metric", "properties": { "metrics": [ [ "AWS/Lambda", "ConcurrentExecutions", "FunctionName", "fam-api-lambda-glad-spaniel", { "label": "API Lambda", "yAxis": "left" } ], [ "...", "fam-auth-lambda-ideal-warthog", { "label": "Auth Lambda" } ] ], "view": "timeSeries", "stacked": false, "region": "ca-central-1", "title": "Lambda Concurrent Executions", "period": 300, "stat": "Maximum" } }, { "height": 5, "width": 8, "y": 0, "x": 16, "type": "metric", "properties": { "view": "timeSeries", "stacked": false, "metrics": [ [ "AWS/RDS", "ACUUtilization", "DBClusterIdentifier", "prod-fam-cluster" ] ], "region": "ca-central-1", "title": "Database Compute Usage" } }, { "height": 5, "width": 8, "y": 10, "x": 8, "type": "metric", "properties": { "metrics": [ [ "AWS/Lambda", "Invocations", "FunctionName", "fam-api-lambda-glad-spaniel", { "label": "API Lambda" } ], [ "...", "fam-auth-lambda-ideal-warthog", { "label": "Auth Lambda" } ] ], "view": "timeSeries", "stacked": false, "region": "ca-central-1", "title": "Lambda Invocations (# of Requests)", "period": 300, "stat": "Sum", "setPeriodToTimeRange": true } }, { "height": 5, "width": 8, "y": 5, "x": 8, "type": "metric", "properties": { "metrics": [ [ "AWS/Lambda", "Duration", "FunctionName", "fam-auth-lambda-together-eagle", { "label": "p99", "stat": "p99" } ], ["...", { "label": "p95", "stat": "p95" }], ["...", { "label": "p90" }], ["...", { "label": "p50", "stat": "p50" }] ], "view": "timeSeries", "stacked": false, "region": "ca-central-1", "title": "Auth Lambda Performance", "period": 300, "stat": "p90" } } ] }
-
If we want to manully edit any of the metrics, select the "Edit" button for the metric
-
The "Graphed Metrics" option shows the displayed services, the "Browse" option shows the available metrics that we could select to put on the chart
-
Select "Alarms -> All alarms" from the left pannel, and from the screen, select "Create alarm"
-
Follow the steps, first select the metric, we'll choose the "Lambda -> By Function Name", and the check the one for fam-api-lambda error. And then we set the "Statistic" to be "sum", and "Conditions" to be "greater than 1". Or whatever we want to be checked
-
And then we could select an existing SNS (Simple Notification Service) topic or create a new one
-
And then we'll just set the name and review to finish the setup
- Environment Management
- Release Management
- Creating a Release
- Database Backups and Restores
- OIDC Client Testing
- FAM Onboarding Ops Guide
- Setup AWS CloudWatch
- Setup AWS EC2 instance to connect to RDS Postgres Database
- Technical Troubleshooting
- Managing Terraform State
- Enable Cloudwatch Logs for API Gateway
- Update AWS CloudFront Certificate
- Verify IDIM BCeID Client SOAP Web Service