Desktop and Application Streaming

Creating custom Amazon CloudWatch dashboards and widgets for Amazon WorkSpaces

Customers often ask how to gain additional insights into their Amazon WorkSpaces operating system resource utilization, such as CPU utilization and memory consumption. In addition, they want to use these metrics with Amazon CloudWatch dimensions to dive into trends and compare WorkSpaces instances.  In a previous blog, we highlighted how to use CloudWatch to understand how  users are connecting to WorkSpaces. In this article, you will learn how to build 6 widgets in CloudWatch to gain additional insight into WorkSpace instance health.

Dashboard examples include:

  • Top 10 WorkSpaces by CPU Usage
  • Top 10 WorkSpaces by Memory Usage
  • Top 10 WorkSpaces by Packet Loss
  • CPU Usage by compute Type
  • CPU Usage by bundleId
  • Data table for CPU Utilization

Walkthrough

Time to read 20 minutes
Time to complete 30 minutes
Cost to complete Detailed cost information on CloudWatch can be found at: Amazon CloudWatch Pricing – Amazon Web Services (AWS)
Learning level 300
Services used

Amazon WorkSpaces

CloudWatch

Top 10 WorkSpaces based on CPU Utilization

In this step, you will create a dashboard showing the top 10 WorkSpaces based on CPU utilization.

  1. Open the CloudWatch Console.
  2. Choose Dashboards from the navigation menu.
  3. On the Custom dashboards tab, select Create dashboard.
  4. For Dashboard name, enter WorkSpacesInformation.
  5. Choose Create dashboard.
  6. Under Data sources types, select CloudWatch, choose Metrics for the Data type, and choose Bar for Widget type.
  7. Choose Next.
  8. On the Browse tab, select WorkSpaces.
  9. Navigate to the Multi source query tab.
  10. Under CloudWatch Metric Insights – query builder, for the Namespace enter AWS/WorkSpaces.
  11. For Metric name, select AVG then AVG(CPUUsage).
  12. For Group by, select WorkspaceId.
  13. For Order by, select AVG() then AVG(DESC).
  14. For Limit, select 10.
    CPU Query
  15. Choose Graph query.
  16. Choose Rename graph (pencil icon) on the widget title and enter Top 10 WorkSpaces by CPU utilization, and choose Apply.
  17. Choose Create widget.
  18. Choose Save.

Top 10 WorkSpaces Based on memory utilization

In this step, you will create a dashboard showing the top 10 WorkSpaces based on memory utilization.

  1. Open the CloudWatch Console.
  2. Choose Dashboards from the navigation menu.
  3. Open the WorkSpaceInformation Dashboard, choose + (Add Widget).
  4. Under Data sources types, select CloudWatch, choose Metrics for the Data type, and choose Bar for Widget type.
  5. Choose Next.
  6. On the Browse tab, select WorkSpaces.
  7. Navigate to the Multi source query tab.
  8. Under CloudWatch Metric Insights – query builder, for the Namespace enter AWS/WorkSpaces.
  9. For Metric name, select AVG then AVG(MemoryUsage).
  10. For Group by, select WorkspaceId.
  11. For Order by, select AVG() then AVG(DESC).
  12. For Limit, select 10.
  13. Choose Graph query.
  14. Choose Rename graph (pencil icon) on the widget title and enter Top 10 WorkSpaces by memory utilization, and choose Apply.
  15. Choose Create widget.
  16. Choose Save.

Top 10 WorkSpaces by packet loss rate

In this step, you will create a dashboard showing the top 10 WorkSpaces based on packet loss rate.

  1. Open the CloudWatch Console.
  2. Choose Dashboards from the navigation menu.
  3. Open the WorkSpaceInformation Dashboard, choose + (Add Widget).
  4. Under Data sources types, select CloudWatch, choose Metrics for the Data type, and choose Bar for Widget type.
  5. Choose Next.
  6. On the Browse tab, select WorkSpaces.
  7. Navigate to the Multi source query tab.
  8. Under CloudWatch Metric Insights – query builder, for the Namespace enter AWS/WorkSpaces.
  9. For Metric name, select AVG then AVG(UDPPacketLossRate).
  10. For Group by, select WorkspaceId.
  11. For Order by, select AVG() then AVG(DESC).
  12. For Limit, select 10.
  13. Choose Graph query.
  14. Choose Rename graph (pencil icon) on the widget title and enter Top 10 WorkSpaces by packet loss rate, and choose Apply.
  15. Choose Create widget.
  16. Choose Save.

Average CPU by instance type

In this step, you will create a dashboard showing the average CPU grouped by instance type.

  1. Open the CloudWatch Console.
  2. Choose Dashboards from the navigation menu.
  3. Open the WorkSpaceInformation Dashboard, choose + (Add Widget).
  4. Under Data sources types, select CloudWatch, choose Metrics for the Data type, and choose Bar for Widget type.
  5. Choose Next.
  6. On the Browse tab, select WorkSpaces.
  7. Navigate to the Multi source query tab.
  8. Under CloudWatch Metric Insights – query builder, for the Namespace enter AWS/WorkSpaces.
  9. For Metric name, select AVG then AVG(CPUUsage).
  10. For Group by, select ComputeType.
  11. For Order by, select AVG() then AVG(DESC).
  12. For Limit, select 10.
  13. Choose Graph query.
  14. Choose Rename graph (pencil icon) on the widget title and enter Average CPU by instance type, and choose Apply.
  15. Choose Create widget.
  16. Choose Save.

Average CPU by BundleId

In this step, you will create a dashboard showing the average CPU for WorkSpaces based on their bundleId.

CPUbyBundleID

  1. Open the CloudWatch Console.
  2. Choose Dashboards from the navigation menu.
  3. Open the WorkSpaceInformation Dashboard, choose + (Add Widget).
  4. Under Data sources types, select CloudWatch, choose Metrics for the Data type, and choose Bar for Widget type.
  5. Choose Next.
  6. On the Browse tab, select WorkSpaces.
  7. Navigate to the Multi source query tab.
  8. Under CloudWatch Metric Insights – query builder, for the Namespace enter AWS/WorkSpaces.
  9. For Metric name, select AVG then AVG(CPUUsage).
  10. For Group by, select BundleId.
  11. For Order by, select AVG() then AVG(DESC).
  12. For Limit, select 10.
  13. Choose Graph query.
  14. Choose Rename graph (pencil icon) on the widget title and enter Average CPU by BundleId, and choose Apply.
  15. Choose Create widget.
  16. Choose Save.

Create a Data table for CPU Utilization by each WorkSpace

In this step you will create a widget to show the CPU for each WorkSpace over time.

WorkSpaces Data Points

  1. Open the CloudWatch Console.
  2. Choose Dashboards from the navigation menu.
  3. Open the WorkSpaceInformation Dashboard, choose + (Add Widget).
  4. Under Data sources types, select CloudWatch, choose Metrics for the Data type, and choose Data table for Widget type.
  5. Choose Next.
  6. On the Browse tab, select WorkSpaces.
  7. Navigate to the Multi source query tab.
  8. Under CloudWatch Metric Insights – query builder, for the Namespace enter AWS/WorkSpaces.
  9. For Metric name, select AVG then AVG(CPUUsage).
  10. For Group by, select WorkspaceId.
  11. For Order by, selectAVG() then AVG(DESC).
  12. For Limit, select 10.
  13. Choose Graph query.
  14. Choose Rename graph (pencil icon) on the widget title and enter WorkSpaces data points over time, and choose Apply.
  15. Choose Create widget.
  16. Choose Save.

Conclusion

In this post, you created widgets to provide insight into WorkSpaces resource utilization; CPU usage, memory consumption, and packet loss. These widgets can be further customized to provide additional insight into the user experience connecting to WorkSpaces. For more information on CloudWatch Logs, review the guide on Amazon CloudWatch Logs. For more information on CloudWatch dashboards, review the guide on using Amazon CloudWatch dashboards.

Jaskie1 Dave Jaskie is a Senior AWS End User Compute Solutions Architect, bringing 15 years of experience in the end-user computing space. Outside of work, Dave enjoys traveling and hiking with his wife and 3 kids.
Aamir Khan, a seasoned Senior Technical Program Manager within the End User Computing Product team, boasts 12 years of industry expertise. Guided by a customer-first approach, his work methodology sets a standard. Beyond the professional realm, Aamir finds joy in family moments and indulges in occasional off-road escapades on his LC-100 series, exploring the wonders of the Pacific Northwest.
Mehrdad Mehrdad Montazeri is a Senior Software Developer with 6+ years experience in Cloud Desktop Visualization and lots of contribution from deep in protocols, platforms and development stacks to users interfaces and clients. When not working, he enjoys being in the sky and flying with different types of planes such as gliders, para-gliders and small planes. .