View a markdown version of this page

Monitoring AWS Amplify - AWS Amplify

Monitoring AWS Amplify

Welcome to the new AWS Amplify

Amplify now puts hosting, a Postgres database, and sign-in in one AWS account. Deploy from your terminal or from Git, check every change in a preview first, and roll back in one step if something breaks.

Looking for Amplify Hosting? See the Amplify Hosting User Guide.

Monitoring helps you keep your app reliable, available, and fast. You can monitor your app with metrics and logs. The metrics and log types that are available depend on how you set up your app.

Access logs record the requests to your app, at the sampling rate that you set, for both its web part and its backend. Runtime logs record the output of your app’s server component. Runtime logs exist only for apps that have a server component, and they cover only the requests that reach the server component.

Where to find metrics

The following table lists where to find metrics for your app.

Topic Description

CloudWatch metrics

The metrics that Amplify publishes to Amazon CloudWatch, including backend metrics, their dimensions, and how to create alarms.

View your metrics

The metric graphs for your app in the Amplify console, and how to filter them.

Where to find logs

The following table lists the log types for your app.

Topic Description

Access logs for your Amplify app

The HTTP request and response records for the requests to your app, at the sampling rate that you set.

Runtime logs for your Amplify app

The output from your app’s server component for the requests that reach it.

Firewall logs

The firewall’s decision for each request, such as allowed or blocked, and the rule that matched.

View your build logs

The build output for a deployment.

Database logs

The errors, slow statements, schema changes, and migration statements of your app’s database.

Which log should I look in?

Amplify keeps a separate log for each part of your app, so the log that answers your question depends on what you see. Start with what you see in the following table, and then check the log in the Look here first column. If you don’t find the cause, check the log in the Then look at column at the same time.

What you see Look here first Then look at

A deployment failed

The deployment log. For more information, see View your build logs.

None

A page doesn’t load or shows an error

The access logs, with the Surface filter set to Web. For more information, see Access logs for your Amplify app.

The runtime logs at the same time. For more information, see Runtime logs for your Amplify app.

Requests are blocked, or users in one place get a 403 error

The firewall logs. For more information, see Firewall logs.

None

An API call or the SDK returns an error

The access logs, with the Surface filter set to Backend. Find the request by its request ID. For more information, see Find a backend request by its request ID.

The database logs at the same time, if the reason on the access log line is a database code, such as 42501.

The app is slow

The latency metrics. Compare the web and backend graphs to see which part is slow. For the web part of your app, the metric is WebLatency. For the backend, the metric is BackendLatency. For more information, see View your metrics.

The access logs for that part, and the time_taken_ms field on each line. For the backend, the slow-query lines in the database logs.

Data is missing or wrong, with no error

The database logs

None

Your own code connects to the database directly

The database logs

None

You want every backend call that one page made

The access logs. For more information, see Follow one page load through your app.

The database logs for any call that failed

Someone changed the settings of your app

AWS CloudTrail. Look for events with the event source amplifygen3.amazonaws.com.

None