AWS Builder Center

Beyond “It Works”: Designing Useful Monitoring with Amazon CloudWatch

Build a practical monitoring plan by connecting logs, metrics, and alarms to the failures users actually experience.

An application can be running while users are having a bad experience.
The process is alive, but requests are slow. The API responds successfully, but background tasks remain unfinished. A deployment completes, but a business operation starts failing.
Monitoring becomes more useful when it starts with these user-visible problems.
Consider a file import application. Users upload a CSV file, wait for processing, and receive an import summary. What should the team observe?
Start with questions that matter
For this application, I would begin with four questions:
  • Are users able to submit files?
  • How long does processing take?
  • How many imports fail?
  • Are accepted imports eventually completed?
These questions guide the telemetry to collect.
Amazon CloudWatch provides capabilities for collecting and querying logs, monitoring metrics, and using dashboards and alarms to observe AWS resources and applications.
Use logs to explain individual events
A message such as “processing failed” provides little context.
A more useful log record might include an import identifier, the processing stage, an error category, and a timestamp.
Structured logs make those fields easier to search and analyze. Reusing the import identifier across stages also helps reconstruct what happened to a particular file.
The goal is to record useful context without unnecessarily copying file contents, credentials, or personal information into logs.
Use metrics to reveal patterns
Logs help investigate a specific import. Metrics help show whether a broader problem is developing.
For this application, useful measurements could include import volume, failure rate, processing duration, and the number of imports still waiting.
Averages deserve careful interpretation. If most imports are fast but a smaller group is extremely slow, a single average can hide that experience. Duration percentiles can provide additional context.
It is also useful to separate technical completion from business success. A function returning normally does not necessarily mean every row in the uploaded file was accepted.
Create alarms with a response in mind
AWS monitoring guidance describes CloudWatch alarms as a way to evaluate conditions and trigger notifications, including through Amazon SNS.
For every proposed alarm, I would ask:
Who receives it? What should they investigate first? What action could they take?
An alert about delayed imports should point toward the relevant dashboard, logs, and processing dependency. Thresholds should reflect the application’s expected workload and acceptable delays.
Test the monitoring itself
In a test environment, introduce a processing error and slow down a dependency.
Then verify that the metrics reflect the problem, the alarm reaches the right destination, and the logs contain enough context to investigate.
A monitoring setup earns its value when it helps someone understand a failure and act on it.
If your application stopped completing background work, how quickly would your monitoring detect it?
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article