In this video, you’ll see how you can monitor Windows desktops on Amazon WorkSpaces
using Amazon Managed Service for Prometheus and Amazon Managed Grafana.
With this solution, service desk teams can quickly identify issues that need
investigation, obtain current and historical data without having to
contact business users, and save troubleshooting time.
This solution deploys a Prometheus server on an Amazon EC2 instance
which polls Prometheus agents on Amazon Workspaces Windows 10
instances periodically, and remote writes metrics to Amazon Managed
Service for Prometheus.
We’ll be using Amazon Managed Grafana
to query and visualize metrics on the Amazon Workspaces infrastructure.
For the purposes of this example, we’ve already taken care of some prerequisites.
For the Amazon CLI, we’ll be using AWS CloudShell.
We also have an empty Amazon WorkSpaces environment,
and an AWS Directory Service for Microsoft Active Directory account
with administrator permissions.
We’ll be creating a user in this directory for our first Workspace,
which we’ll create in a moment.
We also have a couple of virtual private clouds (VPCs).
To get started, we’ll run a script to create the AWS resources needed for this demonstration.
All the scripts we’ll use are available in the links for this video.
Now that the script is finished, let’s see what was created.
We now have an Amazon Workspace running Windows 10, which is still “pending.”
Let’s look for the EC2 instance.
The Prometheus forwarder server is up and running.
We also have a new IAM role that allows for remote write access to the Prometheus server.
There are also new security groups.
There’s a new VPC hosting the Prometheus server.
Along with the VPC, a public subnet and route table were built for sending the data
from the server to our Amazon Managed Service for Prometheus workspace.
Let’s take a quick look at the route table configuration.
The script also created an Internet Gateway and a peering connection
with the Workspaces VPC.
Let’s look at the WorkSpace again.
It’s reached an available status, so we can move on.
Next, we’ll return to AWS CloudShell to define the solution’s variables.
First we’ll obtain the WorkSpace ID.
Now we’ll supply the WorkSpace IP address.
Now we’ll change the format so it works with the YAML file we’re going to configure
on the Prometheus forwarder server.
Let’s do the same for the WorkSpace ID.
Let’s move on to the server shell for our EC2 instance running the Prometheus server.
In our instance, we’ll first run the sudo command to access
the required root privileges.
Now let’s check the directory.
It’s empty, so we’ll need to create a configuration file so it will write metrics
from the Windows 10 Workspace to the Amazon Managed Service for Prometheus.
Let’s define its variables.
We’ll supply the Region for the instance.
Let’s copy the WorkSpace ID from our other CloudShell session.
We’ll do the same for the WorkSpace IP address.
Now we can paste the script for the file.
We’ll check the library again to confirm.
Let’s review the file’s contents.
Now, we’ll enable Prometheus on the server to start forwarding data automatically.
Let’s restart the instance.
We can check its status.
It’s actively running, so we can proceed with building the monitoring solution.
For the next steps, we’ll work in Windows Active Directory
to create a group policy object.
This GPO installs the Windows Exporter software on every
Windows 10 WorkSpace in our OU.
From the CLI, let’s paste the code to download Windows Exporter.
Let’s switch to the Group Policy Management Editor.
Here’s where we configured the policy’s software installation.
Let’s review its Control Panel Settings to see the service we set up.
The policy includes a service to automatically delay the start of the
data forwarding from the Windows 10 WorkSpaces to the Prometheus server.
The delay allows time for all the resources in the WorkSpaces to start up.
Finally, let’s see how our Active Directory is organized.
The Computers OU hosts the WorkSpaces that were assigned by the script we ran,
and is where the group policy is assigned.
Back in the Group Policy Management page, we can see that the policy is
assigned to the Prometheus agent, which can be viewed in the domain.
Now, from one of the WorkSpace instances, let’s confirm it has the
correct resources before we continue with the monitoring solution.
We’ll go to the Services page.
Let’s search for the Windows Exporter service, which sends
out its Prometheus metrics.
Here it’s in a running status and on an automatic delayed start,
as defined by the group policy object.
We’re now ready to build an Amazon Managed Grafana dashboard
for monitoring the WorkSpaces.
In the Amazon Managed Grafana console, we’ve built a Grafana
workspace for this purpose and have a URL to access it.
We’ve got the workspace open in another tab.
First, we’ll add a data source.
We’re adding an Amazon Managed Service for Prometheus service.
Let’s find its Region.
We’ll select and add the data source.
Next, we’ll import a dashboard.
We’ll assign the dashboard to our Prometheus data source.
Let’s import it.
The dashboard visualizes many kinds of useful data, including CPU load,
system threads, network data, hard drive disk space, and memory.
The data is captured historically, so we change the view to see what
happened in custom time frames, such as the last 24 hours.
Now we can see some idle time from when we recently rebooted the Workspaces.
If we had many Workspaces, we could change the IP address of the Windows 10
WorkSpace to see their performance metrics.
When finished with the solution, we can clean up the resources using a cleanup script.
As it’s running, we’ll see the resources cleaned up.
Let’s check the EC2 console.
The forwarder server is stopping, and eventually will be deleted.
Once the script completes, all resources will be torn down except for
the Amazon WorkSpaces and directory.
You’ve just seen how you can monitor Windows desktops on Amazon WorkSpaces
using Amazon Managed Service for Prometheus and Amazon Managed Grafana.
You can learn more about this topic in the description and links for this video.
Thanks for watching. Now it's your turn to try.