Browse the Repo

file-type-icon_docs
file-type-icon_images
file-type-icon01-architecture-overview.md
file-type-icon02-whats-deployed.md
file-type-icon03-security-compliance-compatibility.md
file-type-icon04-how-code-is-organized.md
file-type-icon05-dev-environment.md
file-type-icon06-ci-cd.md
file-type-icon07-monitoring-alerting-logging.md
file-type-icon08-ssh-vpn.md
file-type-icon09-accounts-and-auth.md
file-type-icon10-gruntwork-tools.md
file-type-icon11-deploying-a-docker-service.md
file-type-icon12-migration.md
file-type-icon13-deploying-the-reference-architecture-fr...
file-type-icon14-undeploying-the-reference-architecture.md
file-type-icon15-adding-new-environments-regions-and-acc...
file-type-iconREADME.md
file-type-iconmain
file-type-icon.gitignore
file-type-iconCODEOWNERS
file-type-iconREADME.md

Browse the Repo

file-type-icon_docs
file-type-icon_images
file-type-icon01-architecture-overview.md
file-type-icon02-whats-deployed.md
file-type-icon03-security-compliance-compatibility.md
file-type-icon04-how-code-is-organized.md
file-type-icon05-dev-environment.md
file-type-icon06-ci-cd.md
file-type-icon07-monitoring-alerting-logging.md
file-type-icon08-ssh-vpn.md
file-type-icon09-accounts-and-auth.md
file-type-icon10-gruntwork-tools.md
file-type-icon11-deploying-a-docker-service.md
file-type-icon12-migration.md
file-type-icon13-deploying-the-reference-architecture-fr...
file-type-icon14-undeploying-the-reference-architecture.md
file-type-icon15-adding-new-environments-regions-and-acc...
file-type-iconREADME.md
file-type-iconmain
file-type-icon.gitignore
file-type-iconCODEOWNERS
file-type-iconREADME.md
Single-account Reference Architecture

Single-account Reference Architecture

End-to-end tech stack designed to deploy into a single AWS account. Includes VPCs, EKS, ALBs, CI / CD, monitoring, alerting, VPN, DNS, and more.

Code Preview

Preview the Code

mobile file icon

07-monitoring-alerting-logging.md

down

Monitoring, Alerting and Logging

Now that you've built, tested, and deployed your code, you'll want to to see what's happening in your AWS account:

Metrics

You can find all the metrics for your AWS account on the CloudWatch Metrics Page.

  • Most AWS services emit metrics by default, which you'll find under the "AWS Namespaces" (e.g. EC2, ECS, RDS).

  • Custom metrics show up under "Custom Namespaces." In particular, the cloudwatch-memory-disk-metrics-scripts module is installed on every server to emit metrics not available from AWS by default, including memory and disk usage. You'll find these under the "Linux System" Namespace.

You may want to create a Dashboard with the most useful metrics for your services and have that open on a big screen at all times.

Alerts

A number of alerts have been configured using the alarms modules in module-aws-monitoring to notify you in case of problems, such as a service running out of disk space or a load balancer seeing too many 5xx errors.

That said, you probably don't want to wait for someone to check that page before realizing something is wrong, so instead, you should subscribe to alerts via email or text message as follows:

  1. Go to the SNS Topics Page, select the cloudwatch-alarms topic, and click "Actions -> Subscribe to topic."

  2. Go to the us-east-1 SNS Topics Page, select the route53-cloudwatch-alarms topic, and click "Actions -> Subscribe to topic." The alarms for Route 53 health checks only go to us-east-1, so we have to have a separate SNS topic for them.

If you'd like alarm notifications to go to a Slack channel, check out the sns-to-slack module.

Logs

All of your services have been configured using the cloudwatch-log-aggregation-scripts module and the eks-cloudwatch-container-logs module to send their logs to CloudWatch Logs. Instead of SSHing to each server to see a log file, and worrying about losing those log files if the server fails, you can just go to the CloudWatch Logs Page and browse and search log events for all your servers in near-real-time.

Next steps

If metrics, alerts, and logs aren't enough to diagnose an issue, you may need to connect to your servers using SSH and VPN.

Questions? Ask away.

We're here to talk about our services, answer any questions, give advice, or just to chat.

Ready to hand off the Gruntwork?