Skip to content

How do I troubleshoot CloudWatch dashboard issues?

7 minute read
1

I want to troubleshoot issues with my Amazon CloudWatch dashboard.

Short description

If you have incorrect metric configurations or statistics, inactive metrics, or missing resources, then CloudWatch dashboards can experience issues, such as widgets displaying no data or blank graphs. You might also experience difficulty when you try to modify or remove widgets.

Resolution

Note: If you receive errors when you run  AWS Command Line Interface (AWS CLI) commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.

Verify metric availability

Before you create or troubleshoot dashboard widgets, verify that the metrics are available in the console. Complete the following steps:

  1. Open the CloudWatch console.
  2. In the navigation pane, under Metrics, choose All metrics.
  3. Search for the namespace of the service you want to monitor. For example, enter AWS/EC2, AWS/TransitGateway, or AWS/WorkSpaces.
  4. Verify that the metrics are listed and that you can see recent datapoints.
    Note: If you don't see the metrics, then verify that the resources are active and configured to send metrics to CloudWatch.

Resolve issues with widgets that don't show data or have blank graphs

If your dashboard widget appears blank or shows the "No data available" message, then make sure that you correctly configured the metadata and resources for your metric.

Verify that you use the correct namespace, metric name, dimension, or any other metric metadata

You must correctly name the dimension field for the metric to display data. If you create a widget with incorrect metric metadata such as namespace, metric name, or dimensions, then the metric doesn't show any data.

For Transit Gateway metrics, verify that you use the correct dimension format.

Example configuration with the correct values:

Namespace: AWS/TransitGateway 
Metric name: BytesIn 
Dimension: TransitGateway transit-gateway-id

To fix incorrect metric parameters, complete the following steps:

  1. Open the CloudWatch console.
  2. In the navigation pane, choose Dashboards
  3. Select your dashboard.
  4. Find the widget that you want to modify, and then choose Widget options at the top corner of the widget.
  5. In the dropdown list, choose Edit.
  6. Choose the Browse tab.
  7. Enter the specific metric name in the search field.
  8. Select the correct metric with the correct dimension name.
  9. In the widget, remove the incorrect metric.
  10. Add the correct metric with the correct parameters to the dashboard.
  11. Choose Save.

After you edit the dashboard with the correct metric parameters, the dashboard shows the metric graphs with datapoints.

Make sure that you have the correct source resources

CloudWatch operates on a push-based model and only visualizes data that services push to it. If the source service doesn't publish metrics, then data doesn't appear in the dashboard.

If you access the CloudWatch automatic dashboard for Amazon WorkSpaces and you see the "No data available" message, then verify that you have the appropriate resources that generate metrics.

Note: If no resources of the appropriate type generate metrics in the account, then the dashboard shows the "No data available" message. This is expected behavior.

Confirm that the Amazon WorkSpaces automatic dashboard is specifically designed for standard WorkSpaces metrics. Then, confirm that your account has active standard WorkSpaces resources that generate metrics.

Note: If your environment only contains WorkSpaces Pools, then the automatic dashboard doesn't show data. WorkSpaces Pools metrics are different from standard WorkSpaces metrics.

Confirm that your period setting matches the retention period

Make sure that the period setting for the dashboard matches the metric's retention period. If you selected an incorrect period, then the graph might not show all data points on a widget.

Data points with a period of less than 60 seconds are available for 3 hours. These data points are high-resolution custom metrics. Data points with a period of 60 seconds (1 minute) are available for 15 days. Data points with a period of 300 seconds (5 minutes) are available for 63 days. Data points with a period of 3600 seconds (1 hour) are available for 455 days (15 months).

For example, if a period is set at 30 seconds and the widget time range exceeds 2 weeks, then you can see only the last 3 hours of data.

Note: It's a best practice to keep the period setting at Auto to make sure that the retention time matches the widget time range.

If a metric that you selected on a widget doesn't show any new data for 14 days, then CloudWatch removes the metric from the CloudWatch console. It's a best practice to select periods that show data for more than 14 days. To display the metric on the widget, make sure that you use the same metric data.

Set the correct statistics for your metric

If you select incorrect statistics, then you might see incorrect data points for metrics on a widget. For more information, see CloudWatch statistics definitions.

Remove stuck or unwanted widgets

If you have a discrepancy between the dashboard configuration and the AWS resources, your widgets might get stuck on the dashboard. You also might be unable to delete them through the AWS CLI or console. The dashboard continues to reference metrics from deleted resources and can have issues when you try to manage or edit the dashboard.

To resolve this issue, take one of the following troubleshooting options.

Manually delete the widget

Complete the following steps:

  1. Open the CloudWatch console.
  2. In the navigation pane, choose Dashboards.
  3. Choose the dashboard that you want to delete.
  4. Choose Widget options at the top corner of the widget.
  5. Choose Delete.

Edit dashboard JSON

Important: When you edit the dashboard JSON directly, use caution because incorrect JSON syntax can cause issues with your dashboard. Always keep a backup of your original dashboard configuration before you make any changes.

You can edit the dashboard JSON in the console or AWS CLI to remove widgets.

To edit the dashboard JSON with the console, complete the following steps:

  1. Open the CloudWatch console.
  2. In the navigation pane, choose Dashboards.
  3. Select the dashboard you want to edit.
  4. Choose Actions, and then choose View/edit source.
  5. In the JSON editor, find the sections that corresponds to the widgets you want to delete.
  6. Remove those specific JSON sections.
  7. Choose Save.

To edit the dashboard JSON with AWS CLI, complete the following steps:

  1. To retrieve the current dashboard definition, run the following get-dashboard AWS CLI command:
    aws cloudwatch get-dashboard --dashboard-name your-dashboard-name
    Note: Replace your-dashboard-name with the name of your dashboard.
  2. Edit the returned JSON and remove the unwanted widget sections.
  3. To update the dashboard with the modified JSON, run the following put-dashboard AWS CLI command:
    aws cloudwatch put-dashboard --dashboard-name your-dashboard-name --dashboard-body file://dashboard.json
    Note: Replace your-dashboard-name with the name of your dashboard.

Recreate the dashboard

Complete the following steps:

  1. Open the CloudWatch console.
  2. In the navigation pane, choose Dashboards.
  3. Select the dashboard that you want to recreate.
  4. Choose Actions, and then choose View/edit source.
  5. Copy all the JSON content.
  6. Create a new dashboard.
  7. In the new dashboard, choose Actions, and then choose View/edit source.
  8. Paste your copied JSON, and then remove the sections for the widgets that have issues.
  9. Choose Save.
  10. Delete the old dashboard after you confirm that the new dashboard correctly works.