YURI GRINSHTEYN: Google acquired Stackdriver back in 2014,
and the suite of operations tools in Google Cloud
has come a very long way since then.
Today, cloud monitoring is built right into the Cloud Console,
and I'm here to show you how to set up and use monitoring
in your cloud projects.
This is the Stack Doctor.
[MUSIC PLAYING]
With the integration of monitoring features
into the Cloud Console, you'll notice that the Stackdriver
brand is gone.
But the functionality you've come to depend on
isn't changing.
You'll still be able to use all of the features you're used to.
Let's take a look at those, and what's new.
Let's start by selecting monitoring
from the products menu.
Instead of opening the Stackdriver UI in a new window,
you get a new, better design UI right in the console.
Note that you can still select or configure
the workspace in this new UI.
The concept of workspaces and using them
to aggregate monitoring data across multiple projects
hasn't changed.
Workspaces and their host projects
are still how you create and retain
monitoring configuration data.
Let's take a look at the core features of cloud monitoring.
We'll start by setting up a VM and deploying a web
server on it.
From there, we'll install the monitoring agent,
set up an uptime check, and configure a dashboard
to show us the health of our new service.
We'll put the link to the full steps in the episode notes
so you can easily follow along.
Start by creating a compute engine virtual machine
by going to the products menu and selecting Compute Engine.
From there, create a new instance.
You can leave most options at default.
Once the instance is created, use the SSH functionality
in the console to open a secure terminal
session to your new VM.
We're going to use this to do two things--
install the Apache web server and install the monitoring
agent.
First run sudo apt-get update and sudo apt-get
install apache php to get the latest package versions,
and install Apache.
Then, run these two commands to download and install
the monitoring agent.
Now that the environment is set up,
we're ready to configure cloud monitoring.
Let's first create an uptime check
that will monitor our web service
and potentially notify us if there's a problem.
From the Products menu, select Monitoring
and go to Uptime Checks.
Create a new one.
You'll need to give the machine's external IP address
to enter as the target here.
Test the check before saving it to make sure everything
is configured properly.
Note that this IP address is ephemeral by default
and may change.
You may want to assign a static IP address to this machine,
if this is a service with external users or consumers.
From here, let's configure a dashboard
so we can easily visualize the health of our small service.
We can include charts showing us the availability
and performance of our uptime check
and charts showing us infrastructure utilization
to get a complete picture.
Go to Products, select Monitoring,
and click on Dashboards.
Then create a new dashboard.
To add a chart showing uptime check failures,
select Uptime Check URL as the resource,
and check Past as the metric.
Filter the data through just the uptime check you just created
and use the Count False aggregator to only show you
failures.
Once you've saved this chart, you
can follow a similar process to add other charts
to your dashboard.
You might want to include a chart showing
the performance of your service as reflected
by the uptime check latency metric.
You can also include charts showing
your resource utilization of your infrastructure.
Looking at metrics like CPU utilization of your VM
is a great place to start.
One of the new features that's being made available
with this release is the Dashboards API.
You'll now be able to automate the creation of dashboards
in your workspaces and generally automate
more of your monitoring setup.
We'll come back to dashboard and monitoring
automation in future episodes.
Once your monitoring is setup, you'll
probably want alerting to get notified
if the service goes down.
Since we've already set up the monitoring,
we can create a new alerting policy
by clicking on it in the menu.
We can set our uptime check as the resource type,
and set the metric to make sure that it passes,
then set up an email notification.
If you want to see more details on how to set it up,
check out the link below to the earlier
video we did on alerting.
That wraps up our intro to cloud monitoring
and our tour of its new integration
in the Cloud Console.
We created a service, configured a dashboard
to show us its health, and set up
alerting to let us know if it has any issues.
You are now ready to start using cloud monitoring
in your own environment.
I hope you are as excited about the future of cloud monitoring
and these new features as I am.
That's it for this episode.
Come back next time, when we take a look
at what's new in cloud logging.
This is the Stack Doctor.
Stay healthy out there.
[MUSIC PLAYING]