AWS › Monitoring (CloudWatch)

What are CloudWatch custom metrics, and how do they let you monitor application specific data beyond what AWS provides by default?

Intermediate

Answer

Custom metrics let you publish your own application specific data points to CloudWatch, such as the number of active users, a business specific error rate, or the length of an internal processing queue, using the CloudWatch API or SDK directly from within your application code, extending CloudWatch's monitoring capabilities beyond the default infrastructure level metrics that AWS automatically provides for most services.
aws cloudwatch put-metric-data --namespace MyApplication --metric-name ActiveUsers --value 342
Real-world example An e commerce application publishes a custom metric tracking the number of items currently in customer shopping carts, allowing the business team to monitor this application specific indicator directly alongside standard infrastructure metrics on the same CloudWatch dashboard.

Common follow-ups: What is the cost structure for publishing and storing custom metrics?;How frequently can custom metrics be published to CloudWatch?