Monitor your WorkSpaces using CloudWatch metrics
WorkSpaces and Amazon CloudWatch are integrated, so you can gather and analyze performance metrics. You can monitor these metrics using the CloudWatch console, the CloudWatch command line interface, or programmatically using the CloudWatch API. CloudWatch also allows you to set alarms when you reach a specified threshold for a metric.
For more information about using CloudWatch and alarms, see theĀ Amazon CloudWatch User Guide.
Prerequisites
To get CloudWatch metrics, enable access on port 443 on the AMAZON
subset in
the us-east-1
Region.
For more information, see IP address and port requirements for
WorkSpaces.
WorkSpaces metrics
The AWS/WorkSpaces
namespace includes the following metrics.
Metric | Description | Dimensions | Statistics | Units |
---|---|---|---|---|
|
The number of WorkSpaces that returned a healthy status. |
|
Average, Sum, Maximum, Minimum, Data Samples |
Count |
|
The number of WorkSpaces that returned an unhealthy status. |
|
Average, Sum, Maximum, Minimum, Data Samples |
Count |
|
The number of connection attempts. |
|
Average, Sum, Maximum, Minimum, Data Samples |
Count |
|
The number of successful connections. |
|
Average, Sum, Maximum, Minimum, Data Samples |
Count |
|
The number of failed connections. |
|
Average, Sum, Maximum, Minimum, Data Samples |
Count |
|
The amount of time it takes to initiate a WorkSpaces session. |
|
Average, Sum, Maximum, Minimum, Data Samples |
Second (time) |
|
The round trip time between the WorkSpaces client and the WorkSpace. |
|
Average, Sum, Maximum, Minimum, Data Samples |
Millisecond (time) |
|
The number of connections that were closed, including user-initiated and failed connections. |
|
Average, Sum, Maximum, Minimum, Data Samples |
Count |
|
The number of WorkSpaces that have a user connected. |
|
Average, Sum, Maximum, Minimum, Data Samples |
Count |
|
The number of WorkSpaces that are stopped. |
|
Average, Sum, Maximum, Minimum, Data Samples |
Count |
|
The number of WorkSpaces that are under maintenance. |
|
Average, Sum, Maximum, Minimum, Data Samples |
Count |
|
The number of device authentication signature validation attempts. |
|
Average, Sum, Maximum, Minimum, Data Samples |
Count |
|
The number of successful device authentication signature validations. |
|
Average, Sum, Maximum, Minimum, Data Samples |
Count |
|
The number of failed device authentication signature validations. |
|
Average, Sum, Maximum, Minimum, Data Samples |
Count |
|
Days left before the root certificate associated with the directory is expired. |
|
Average, Sum, Maximum, Minimum, Data Samples |
Count |
1 WorkSpaces periodically sends status requests to a WorkSpace.
A WorkSpace is marked Available
when it responds to these requests, and
Unhealthy
when it fails to respond to these requests. These metrics
are available at a per-WorkSpace level of granularity, and also aggregated for all
WorkSpaces in an organization.
2 WorkSpaces records metrics on connections made to each WorkSpace. These metrics are emitted after a user has successfully authenticated via the WorkSpaces client and the client then initiates a session. The metrics are available at a per-WorkSpace level of granularity, and also aggregated for all WorkSpaces in a directory.
3 WorkSpaces periodically sends connection status requests to a WorkSpace. Users are reported as connected when they are actively using their sessions. This metric is available at a per-WorkSpace level of granularity, and is also aggregated for all WorkSpaces in an organization.
4 This metric applies to WorkSpaces that are configured with an AutoStop running mode. If you have maintenance enabled for your WorkSpaces, this metric captures the number of WorkSpaces that are currently under maintenance. This metric is available at a per-WorkSpace level of granularity, which describes when a WorkSpace went into maintenance and when it was removed.
5 If the trusted devices feature is enabled for the directory, Amazon WorkSpaces uses certificate-based authentication to determine whether a device is trusted. When users attempt to access their WorkSpaces, these metrics are emitted to indicate successful or failed trusted device authentication. These metrics are available at a per-directory level of granularity, and only for the Amazon WorkSpaces Windows and macOS client applications.
6 Not available on WorkSpaces Web Access.
Dimensions for WorkSpaces metrics
To filter the metric data, use the following dimensions.
Dimension | Description |
---|---|
|
Filters the metric data to the WorkSpaces in the specified directory.
The form of the directory ID is |
|
Filters the metric data to the specified WorkSpace. The form of the
WorkSpace ID is |
|
Filters the metric data to the specified root certificate
associated with the directory. The form of the certificate ID is
|
Monitoring example
The following example demonstrates how you can use the AWS CLI to respond to a CloudWatch alarm and determine which WorkSpaces in a directory have experienced connection failures.
To respond to a CloudWatch alarm
-
Determine which directory the alarm applies to using the describe-alarms command.
aws cloudwatch describe-alarms --state-value "ALARM"
{ "MetricAlarms": [ { ... "Dimensions": [ { "Name": "DirectoryId", "Value": "
directory_id
" } ], ... } ] } -
Get the list of WorkSpaces in the specified directory using the describe-workspaces command.
aws workspaces describe-workspaces --directory-id
directory_id
{ "Workspaces": [ { ... "WorkspaceId": "
workspace1_id
", ... }, { ... "WorkspaceId": "workspace2_id
", ... }, { ... "WorkspaceId": "workspace3_id
", ... } ] } -
Get the CloudWatch metrics for each WorkSpace in the directory using the get-metric-statistics command.
aws cloudwatch get-metric-statistics \ --namespace AWS/WorkSpaces \ --metric-name ConnectionFailure \ --start-time 2015-04-27T00:00:00Z \ --end-time 2015-04-28T00:00:00Z \ --period 3600 \ --statistics Sum \ --dimensions "Name=WorkspaceId,Value=
workspace_id
"{ "Datapoints" : [ { "Timestamp": "2015-04-27T00:18:00Z", "Sum": 1.0, "Unit": "Count" }, { "Timestamp": "2014-04-27T01:18:00Z", "Sum": 0.0, "Unit": "Count" } ], "Label" : "ConnectionFailure" }