Monitor your WorkSpaces using CloudWatch metrics - Amazon WorkSpaces

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

Available1

The number of WorkSpaces that returned a healthy status.

DirectoryId

WorkspaceId

RunningMode

Protocol

ComputeType

BundleId

Average, Sum, Maximum, Minimum, Data Samples

Count

Unhealthy1

The number of WorkSpaces that returned an unhealthy status.

DirectoryId

WorkspaceId

RunningMode

Protocol

ComputeType

BundleId

Average, Sum, Maximum, Minimum, Data Samples

Count

ConnectionAttempt2

The number of connection attempts.

DirectoryId

WorkspaceId

RunningMode

Protocol

ComputeType

BundleId

Average, Sum, Maximum, Minimum, Data Samples

Count

ConnectionSuccess2

The number of successful connections.

DirectoryId

WorkspaceId

RunningMode

Protocol

ComputeType

BundleId

Average, Sum, Maximum, Minimum, Data Samples

Count

ConnectionFailure2

The number of failed connections.

DirectoryId

WorkspaceId

RunningMode

Protocol

ComputeType

BundleId

Average, Sum, Maximum, Minimum, Data Samples

Count

SessionLaunchTime2,6

The amount of time it takes to initiate a WorkSpaces session.

DirectoryId

WorkspaceId

RunningMode

Protocol

ComputeType

BundleId

Average, Sum, Maximum, Minimum, Data Samples

Second (time)

InSessionLatency2,6

The round trip time between the WorkSpaces client and the WorkSpace.

DirectoryId

WorkspaceId

RunningMode

Protocol

ComputeType

BundleId

Average, Sum, Maximum, Minimum, Data Samples

Millisecond (time)

SessionDisconnect2,6

The number of connections that were closed, including user-initiated and failed connections.

DirectoryId

WorkspaceId

RunningMode

Protocol

ComputeType

BundleId

Average, Sum, Maximum, Minimum, Data Samples

Count

UserConnected3

The number of WorkSpaces that have a user connected.

DirectoryId

WorkspaceId

RunningMode

Protocol

ComputeType

BundleId

Average, Sum, Maximum, Minimum, Data Samples

Count

Stopped

The number of WorkSpaces that are stopped.

DirectoryId

WorkspaceId

RunningMode

Protocol

ComputeType

BundleId

Average, Sum, Maximum, Minimum, Data Samples

Count

Maintenance4

The number of WorkSpaces that are under maintenance.

DirectoryId

WorkspaceId

RunningMode

Protocol

ComputeType

BundleId

Average, Sum, Maximum, Minimum, Data Samples

Count

TrustedDeviceValidationAttempt5,6

The number of device authentication signature validation attempts.

DirectoryId

Average, Sum, Maximum, Minimum, Data Samples

Count

TrustedDeviceValidationSuccess5,6

The number of successful device authentication signature validations.

DirectoryId

Average, Sum, Maximum, Minimum, Data Samples

Count

TrustedDeviceValidationFailure5,6

The number of failed device authentication signature validations.

DirectoryId

Average, Sum, Maximum, Minimum, Data Samples

Count

TrustedDeviceCertificateDaysBeforeExpiration6

Days left before the root certificate associated with the directory is expired.

CertificateId

Average, Sum, Maximum, Minimum, Data Samples

Count

CPUUsage

The percentage of the CPU resource used.

DirectoryId

WorkspaceId

RunningMode

Protocol

ComputeType

BundleId

Average, Maximum, Minimum

Percentage

MemoryUsage

The percentage of the machine memory used.

DirectoryId

WorkspaceId

RunningMode

Protocol

ComputeType

BundleId

Average, Maximum, Minimum

Percentage

RootVolumeDiskUsage

The percentage of the root disk volume used.

DirectoryId

WorkspaceId

RunningMode

Protocol

ComputeType

BundleId

Average, Maximum, Minimum

Percentage

UserVolumeDiskUsage

The percentage of the user disk volume used.

DirectoryId

WorkspaceId

RunningMode

Protocol

ComputeType

BundleId

Average, Maximum, Minimum

Percentage

UDPPacketLossRate7

The percentage of packets dropped between the client and the gateway.

DirectoryId

WorkspaceId

RunningMode

Protocol

ComputeType

BundleId

Average, Maximum, Minimum, Data Samples

Percentage

UpTime

The time since the last reboot of a WorkSpace.

DirectoryId

WorkspaceId

RunningMode

Protocol

ComputeType

BundleId

Average, Maximum, Minimum, Data Samples

Seconds

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.

7 This metric measures average package loss.

  • On PCoIP: Measures average package loss at gateway from the client.

  • On WSP: Measures average package loss from client towards the gateway.

Dimensions for WorkSpaces metrics

To filter the metric data, use the following dimensions.

Dimension Description

DirectoryId

Filters the metric data to the WorkSpaces in the specified directory. The form of the directory ID is d-XXXXXXXXXX.

WorkspaceId

Filters the metric data to the specified WorkSpace. The form of the WorkSpace ID is ws-XXXXXXXXXX.

CertificateId

Filters the metric data to the specified root certificate associated with the directory. The form of the certificate ID is wsc-XXXXXXXXX.

RunningMode

Filters the metric data to the WorkSpaces by their running mode. The form of the running mode is AutoStop or AlwaysOn.

BundleId

Filters the metric data to the WorkSpaces by the protocol. The form of the bundle is wsb-XXXXXXXXXX.

ComputeType

Filters the metric data to the WorkSpaces by the compute type.

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
  1. 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" } ], ... } ] }
  2. 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", ... } ] }
  3. 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" }