View a markdown version of this page

Viewing and monitoring integrations with Amazon S3 Tables - Amazon Aurora

Viewing and monitoring integrations with Amazon S3 Tables

Important

This is preview documentation for the Aurora PostgreSQL integration with Amazon S3 Tables. Before using this capability, review the Betas and Previews terms in the AWS Service Terms.

You can monitor an Aurora PostgreSQL integration with Amazon S3 Tables in several ways: check the status of the integration, check the replication state of each table, view Amazon CloudWatch metrics, and subscribe to Amazon RDS events.

Viewing an integration

You can view an integration and its status with the AWS Management Console, the AWS CLI, or the Amazon RDS API.

To view an integration in the console
  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the navigation pane, choose Integrations. The Status column shows the status of each integration.

  3. Choose an integration name to view its details, including the source and target Amazon Resource Names (ARNs) and the creation date.

To view an integration with the AWS CLI, use the describe-integrations command with the --integration-identifier option:

Example

For Linux, macOS, or Unix:

aws rds describe-integrations \ --integration-identifier arn:aws:rds:us-east-1:111122223333:integration:5b9f3d2e-1111-2222-3333-444455556666

For Windows:

aws rds describe-integrations ^ --integration-identifier arn:aws:rds:us-east-1:111122223333:integration:5b9f3d2e-1111-2222-3333-444455556666

The response includes the integration name and ARN, the source DB cluster ARN, the target table bucket ARN, the data rules, and the status.

To list every integration in the current AWS Region with only its name and status, use the --query option:

Example

For Linux, macOS, or Unix:

aws rds describe-integrations \ --query "Integrations[].[IntegrationName,Status]" \ --output table

For Windows:

aws rds describe-integrations ^ --query "Integrations[].[IntegrationName,Status]" ^ --output table

To view an integration with the Amazon RDS API, use the DescribeIntegrations operation with the IntegrationIdentifier parameter.

Integration statuses

An integration has one of the following statuses. The Amazon RDS console shows each status in the Status column of the integrations list.

Status Description
creating The integration is being created, and the initial full sync is running. The time it takes to reach the active status depends on the number and size of the source tables.
active Aurora is replicating data to the target.
modifying Aurora is applying a change that you made to the integration.
syncing Aurora is reloading data for some or all tables. You requested a resync, or Aurora started one to recover from an error or a data definition language (DDL) change. For more information, see Resyncing integrations with Amazon S3 Tables.
needs_attention The integration needs an action from you, for example restoring the integration's access to the target table bucket or to a AWS Key Management Service (AWS KMS) key. After you fix the cause, resync the integration.
failed The integration encountered an error that it cannot recover from. You must delete the integration and create it again.
deleting The integration is being deleted.

An integration enters the needs_attention status when it cannot continue until you fix a problem in your account. For example:

  • The integration lost access to the target table bucket, for example because the bucket policy changed (RDS-EVENT-0589).

  • The integration lost access to an AWS KMS key (RDS-EVENT-0588).

  • A resync of one or more tables could not complete.

To recover, fix the cause, and then resync the integration. To find the affected tables, see Per-table status. For resync instructions, see Resyncing tables manually.

An integration enters the failed status when it encounters an error that it cannot recover from. The following can cause this status:

  • All of the integration's grants on its AWS KMS key are revoked. For more information, see Customer managed key for the integration.

  • A key policy denies the integration permission to use the customer managed AWS KMS key that encrypts the target table bucket. For more information, see Customer managed key for the target table bucket.

  • A resync fails in a way that stops replication. Aurora sends RDS-EVENT-0587 with the message "The integration failed during resynchronization and can no longer replicate data."

To recover, delete the integration and create a new one. For more information, see Recreating an integration.

Table states

Each replicated table has its own replication state, separate from the integration status. An integration can be active while a table is FAILED. A table can be in one of the following states.

State Description
SYNCED The table is replicating and is up to date.
RESYNC_REQUIRED A resync of the table is pending. Either the integration determined that the table needs a resync or you requested one, and the resync has not started yet.
RESYNC_INITIATED A resync of the table has started. For more information, see Automatic resync.
RESYNC_REPLAYING The table's data was reloaded, and the changes made during the reload are being applied.
FAILED The table cannot be replicated, for example because its primary key was dropped. The cause appears in the status_reason column of the status table. Fix the cause, and then take the action listed for that status_reason value in Per-table status. After some fixes, the integration syncs the table automatically. After others, you must resync the table.
Note

If you drop a source table or remove a table from the data rules, the table's row is removed from the status table (described in Per-table status). If you delete a target table directly in the table bucket instead of through the integration, the table enters the FAILED state with the reason TARGET_TABLE_DELETED. The other tables in the integration keep replicating.

Per-table status

Aurora keeps a status table in the target table bucket that records the replication state of each table. The console provides sample queries that you can run with Amazon Athena or with your preferred query engine. Before you query, turn on integration with AWS analytics services in the Region of the target table bucket. For instructions, see Turning on integration with AWS analytics services.

If the table bucket is in another account, the status table is in that account, and the source account cannot query it. Run the status queries from the table bucket owner's account. For more information, see Using a table bucket in another account.

To run a status query from the console
  1. Open the integration details page in the Amazon RDS console, as described in Viewing an integration.

  2. Choose the Table status tab.

  3. Choose a query from the Choose a query list.

  4. Choose Run query in Athena.

    The Athena console opens with the query, catalog, and database already selected.

You can also copy a query and run it in any compatible engine.

The status table is named integration_table_status_integration_id, where integration_id is the integration ID (the last part of the integration ARN, for example 5b9f3d2e-1111-2222-3333-444455556666) with its hyphens replaced by underscores. It is in the integrations_metadata namespace of the target Amazon S3 Tables catalog. It has the following eight columns, in order.

Column Description
source_table_name The source table, in the form database.schema.table. Each name appears as it is in the source database, with its case and any hyphens kept. A period or backslash within a name is preceded by a backslash.
schema_version The version of the status table schema.
target_table_name The name of the target Apache Iceberg table, in the form namespace.table.
target_table_arn The ARN of the target Iceberg table.
target_table_current_state The current replication state of the table. The values are uppercase: SYNCED, RESYNC_REQUIRED, RESYNC_INITIATED, RESYNC_REPLAYING, FAILED.
status_reason Why the table is in the FAILED state, as an uppercase reason code such as SOURCE_TABLE_MISSING_PRIMARY_KEY, SOURCE_UNSUPPORTED_TYPE, or TARGET_ACCESS_DENIED.
last_modified_time When the state last changed.
status_detail A sentence that explains the status_reason value and, where possible, the remedy. It is empty when the table is healthy. It can be missing on integrations created before this column was added. Treat it as advisory text, and use status_reason when you make decisions.

The following table lists the status_reason values that a FAILED table can show, and what to do about each one. For worked examples, see A table is not being replicated.

status_reason What to do
SOURCE_TABLE_MISSING_PRIMARY_KEY Add a primary key to the source table. The integration then syncs the table.
SOURCE_PK_FILTERED Change the data rules so that they include the primary key columns. If a key column holds sensitive data, do not include it. A table cannot replicate while a data rule excludes part of its primary key. Instead, define a primary key on non-sensitive columns at the source, or exclude the table.
SOURCE_UNSUPPORTED_TYPE Exclude the column with a data rule, or change its type at the source, and then resync the table.
SOURCE_UNSUPPORTED_VALUE, SOURCE_UNSUPPORTED_PK_VALUE Correct the value at the source, and then resync the table.
SOURCE_UNSUPPORTED_TABLE_TYPE The table type is not supported, for example a partitioned or unlogged table. For more information, see Aurora PostgreSQL table limitations.
SOURCE_UNSUPPORTED_TABLE_NAME Rename the table to a supported name, and then resync the table.
SOURCE_UNSUPPORTED_COLUMN_NAME Rename the column to a supported name, and then resync the table.
TARGET_NAME_COLLISION Another table already uses the target name. Rename one of the source tables, or exclude one of them with a data rule.
TARGET_ACCESS_DENIED Fix the table bucket resource policy, and then resync the table. For the policy, see Creating the table bucket and resource policy.
TARGET_TABLE_DELETED The target table was deleted outside the integration. Resync the table.
TARGET_TABLE_IN_USE A table with the same name already exists in the target. This can happen when you recreate an integration. For more information, see Recreating an integration.
DDL_APPLY_FAILED Correct the schema change at the source, and then resync the table.
RESYNC_PERMANENTLY_REJECTED Automatic resyncs kept failing. Fix the cause, and then resync the integration.
SOURCE_ERROR_UNRECOGNIZED Check the source table and its status_detail, and then resync the table.
INTERNAL_ERROR The failure was caused by an internal error, not by the table or its data. Contact AWS Support.

To list every table, with the most recently changed first, run the following query:

SELECT source_table_name, target_table_name, target_table_arn, target_table_current_state, status_reason, last_modified_time, status_detail FROM "s3tablescatalog/my-table-bucket"."integrations_metadata"."integration_table_status_5b9f3d2e_1111_2222_3333_444455556666" ORDER BY last_modified_time DESC;

To find only the tables that need attention, filter on the state:

SELECT source_table_name, status_reason, status_detail FROM "s3tablescatalog/my-table-bucket"."integrations_metadata"."integration_table_status_5b9f3d2e_1111_2222_3333_444455556666" WHERE target_table_current_state = 'FAILED';
Note

When you delete an integration, its status table remains in the target table bucket. You can delete it yourself. For more information, see Removing the source and target resources.

Metrics

You can view integration metrics on the Metrics tab of the integration details page in the Amazon RDS console, or in Amazon CloudWatch. On the Metrics tab, you can change the time range (1 hour, 3 hours, 12 hours, 1 day, 3 days, or a custom range) and switch between UTC and your local time zone. To track how far the target is behind the source, use the ReplicationLag metric.

In CloudWatch, the metrics are in the AWS/RDS/ZETL namespace, even though this integration is not a zero-ETL integration. Each metric has the dimension IntegrationId. If your table bucket is in another account, the metrics are in the account that owns the source DB cluster, not in the table bucket owner's account.

The following table lists the metrics.

Metric (console name) CloudWatch metric name Statistic and unit Description
Replication lag ReplicationLag Maximum, seconds How far the target is behind the source, as a time delay.
Bytes processed BytesProcessed Sum, bytes The volume of data processed from the source since integration creation.
Rows inserted InsertCount Sum, count The number of insert events applied to the target.
Rows updated UpdateCount Sum, count The number of update events applied to the target.
Rows deleted DeleteCount Sum, count The number of delete events applied to the target.
DDL statements applied DdlCount Sum, count The number of schema changes applied to the target.
Integration health IntegrationHealthy Minimum, 0 or 1 The overall health of the integration.
Tables replicating TablesReplicating Maximum, count The number of tables that are replicating.
Tables with errors TablesErrored Maximum, count The number of tables in an error state.
Tables dropped TablesDropped Maximum, count The number of tables dropped from replication.

A healthy integration has an IntegrationHealthy value of 1 and a TablesErrored value of 0, and its ReplicationLag is not growing over time. If TablesErrored is greater than 0, find the failed tables as described in Per-table status. If ReplicationLag keeps growing, see Data is missing or delayed.

Events

Aurora sends Amazon RDS events for the integration. Events are delivered through RDS event subscriptions, and you can send them to a target such as an Amazon Simple Notification Service (Amazon SNS) topic. To receive these events, create an event subscription with the source type integration-s3tables. If your table bucket is in another account, create the subscription in the account that owns the source DB cluster.

Aurora sends events for integration lifecycle changes (creating, active, modifying, and deleting), for resyncs (started, completed, and failed), and for table problems. The table problem events are the following:

  • One or more tables failed (RDS-EVENT-0590).

  • Tables were excluded from replication (RDS-EVENT-0591).

  • The target became inaccessible, for example because the bucket policy changed (RDS-EVENT-0589).

  • The integration cannot use an AWS KMS key (RDS-EVENT-0588).

The following table lists the resync events.

Event ID Message
Resync started RDS-EVENT-0585 Varies by scope and who started the resync. See the RDS-EVENT-0585 table that follows.
Resync completed RDS-EVENT-0586 Your integration with Amazon S3 Tables finished resynchronizing and is replicating data.
Resync failed RDS-EVENT-0587 Varies by cause. See the RDS-EVENT-0587 table that follows.

When a resync starts, the RDS-EVENT-0585 message names the scope of the resync (full or partial) and who started it, as shown in the following table.

Scope Started by Message
Full You Full resynchronization of the integration with S3 Tables initiated at your request.
Selected tables You Resynchronization of selected tables in the integration with S3 Tables initiated at your request.
Full Amazon RDS Full resynchronization of the integration with S3 Tables initiated by Amazon RDS.
Selected tables Amazon RDS Resynchronization of selected tables in the integration with S3 Tables initiated by Amazon RDS.

Amazon RDS starts a resync on its own to recover from an error or to apply a DDL change. For more information, see Automatic resync.

When a resync fails, the RDS-EVENT-0587 message gives the reason, as shown in the following table.

Cause Message
Timed out The resynchronization of the integration timed out. Resynchronize the integration, and contact AWS Support if the problem persists.
Could not start Unable to start the resynchronization of the integration. Contact AWS Support.
Replication failed The integration failed during resynchronization and can no longer replicate data. Delete the integration and create it again, and contact AWS Support if the problem persists.

The failure message is also shown as the integration's error message in DescribeIntegrations.

Table events are grouped. Changes within about 10 seconds are sent as one event. The event for failed tables (RDS-EVENT-0590) names the tables. The event for tables that were excluded from replication (RDS-EVENT-0591) gives only the number of tables. Table events are best effort, so use the status table as the record of each table's state.