Database Status

Although the metrics we covered earlier will give you good insight into how well your cluster is performing, you can also directly query Amazon DocumentDB for the status of a cluster or individual instances.

Cluster or instance status does not tell you how well the database is performing in terms of servicing database clients. However, it does give you visibility into whether the cluster or instance is available, undergoing routine maintenance, upgrading, or experiencing an outage.

You can retrieve cluster or instance status on the console or through the AWS CLI or SDKs. Here is an example of getting cluster status using the AWS CLI:

aws docdb describe-db-clusters --db-cluster-identifier getting-started-with-documentdb --query 'DBClusters[*].[DBClusterIdentifier,Status]'

Output:

Amazon CloudWatch Log Filter

Here is an example of getting an individual instance status using the AWS CLI:

aws docdb describe-db-instances --db-instance-identifier getting-started-with-documentdb --query 'DBInstances[*].[DBInstanceIdentifier,DBInstanceStatus]'

Output:

Amazon CloudWatch Log Filter

Besides doing an ad-hoc status check, you can integrate database status into an overall application health dashboard in one of two ways.

  • You can retrieve cluster and instance status programmatically and put values into your own custom dashboard application.
  • You can create a custom Amazon CloudWatch metric to display on an Amazon CloudWatch dashboard. One approach would use a scheduled Lambda function to query for cluster status and inject the result into Amazon CloudWatch as a metric.

Amazon CloudWatch Custom Metric