[MUSIC PLAYING]
KYLE BENSON: Hi.
I'm Kyle Benson.
I'm a Product Manager inside of the Cloud Operations team.
And today, I'm going to be walking you
through how to interact with third-party processes running
on GCE virtual machines using the new Cloud Ops Agent.
Let's get started.
What you'll notice in my environment
here is I have a couple of things.
I have this default, pretty simple Terraform file.
Now, I've already used this to provision the infrastructure
that I'll be working with.
We like to use Terraform a lot here at Google.
When we provide ways to spin resources up,
Terraform is one of the things we make it really
easy to get started with.
And so I'm using tools that I think
will be easy for people watching this elsewhere to get started
with and will provide some of the repositories and resources
for this in the future as well.
So we have a couple of instances already spun up.
We've got three VMs.
And what we're actually going to do today
is deploy the new Cloud Ops Agent as well as
an Nginx server to each of those systems using Ansible.
And so Ansible is a configuration management tool
that makes it really easy to manage instances at scale.
And it uses a couple of existing protocols like SSH.
And it uses Python on Linux systems
to make it really easy to get started and interact
with those systems.
So before I get started, there's a couple
of things I have to do just to make sure
that we're ready to go.
The first one I'm going to do is I'm going to run ansible -m.
I'm going to ping these systems and specify that I
want to ping all of them.
And then we're going to specify the key file that I'm using--
not the ky file--
[INAUDIBLE] ssh/google_compute_engine.
Cool.
So I just ran a really simple ping module inside of Ansible.
And what that actually does is it just reaches out
to the systems, ensures that I can connect, and then it exits.
It doesn't make any changes to the system,
nothing too wild going on.
And inside my inventory file, I've already
defined what these three systems are,
and I have an SSH key set up for them to interact with.
Let's go ahead and run this playbook.
Now before I do that, I guess I should show you
what happens in this playbook.
So we have a really simple role here, this Google Cloud Ops
Agent role, where we take a lot of the work underneath
and just make it really easy to present to you.
Now, we provide the ability to install the Cloud Ops Agent
in a bunch of different ways.
You can do it through the UI.
So if you're on console--
if you're on the Google Cloud console,
you can do it from there.
You can also use Puppet, Chef, Terraform, or Ansible.
And we provide the mechanisms to make it easy for each of them.
So here, we'll use the role.
And then below that, we have a couple of tasks.
One is going to install Nginx.
Then we're going to template these files out,
make sure that the configuration is present for Nginx.
Then we'll install the Ops Agent configuration,
make sure that those are OK and that it knows to track Nginx.
And then we're going to restart the services.
So it's pretty simple in terms of what it's trying to do,
but it's going to make our deployment really easy.
And as we start to do this for more and more systems,
it really reduces the level of effort
that we need to manage in terms of automating this
across all these environments.
So let's specify Ansible Playbook-- playbook.yaml.
Now, playbook is an arbitrary name.
It can be named whatever you want.
I just find that it's really easy to name it
for the context of this video and as we get started
to make it easy to find.
From there, we're going to specify the inventory we're
working with, which is inventory.yaml,
and specify that key file one more time.
[INAUDIBLE] And we'll let this run through.
OK, so it's already started.
One of the really nice things about working from Cloud Shell
is that I actually can use the gcloud command
to connect to these systems first,
make sure that I can SSH.
It actually associates the SSH key with it at that point
and then stores it locally inside of my Cloud Shell.
That makes it really easy for the purposes of this demo
to get up and running.
You can run that through a loop and just
make everything available to you,
and then just have everything get automatically connected
to it.
One of the nice things about the Ops Agent
is that when we deploy this, it's
a single agent in terms of the RPM that we provide.
But there's actually two systems running underneath.
One is Fluent Bit, which does the log collection.
And the metrics are actually collected by the OpenTelemetry
collector, which is a relatively new collector for us
and part of the CNCF Foundation.
It's a new way or a more modern way of collecting metrics
across systems.
And we've been really excited to work with it and adopt it.
So we've been providing a bunch of different third-party
integrations for it, trying to make it as easy as possible,
with Nginx being one of them.
We've also provide integrations for Redis, and Apache,
and MySQL.
And a bunch of other integrations
and third-party services are going
to be coming later this year and early next year.
So with all that being said, if we
take a look at this playbook, we can actually
see that it ran through successfully.
And I'm just going to scroll to the top here.
The Cloud Ops Agent did some pre-flight checks,
made sure everything looked good there, installed the agent.
And then a little further down, we just set everything up
to get the configuration going.
So we started Nginx.
We started the Ops Agent with these new configuration files.
Or I should say, we configured them,
and then we restarted the agents and the Nginx agents.
And we should be ready to go now.
So if I go into my Dashboards, I'm
just going to refresh this page real quick
to make sure everything I need is there.
And if I wanted to explore a little bit about my systems,
I could do that by jumping into VM Instances.
And if I scroll down here a little bit,
you can see that I have a couple of different instances here.
So I have three instances from a GKE, a Kubernetes cluster
deployed on Google Cloud.
I also have these three that I'm managing.
Now, the GKE instances, you don't install the agent too.
That's something we manage for you by default, where
on these individual instances, we're actually deploying
the agent individually.
You can see a little bit more information about these.
If I wanted to, I could actually copy this IP address
and jump in and see that I am serving content.
This is my internal IP.
That's the project that I'm working on.
And we're going to spin that down after this demo.
And then from there, we're actually
going to take a look at this system.
Or if I wanted to, I could actually jump into my Processes
here and look at all of my processes
across the entire system.
So let's do that.
Now, you might not see a ton of activity from the environment
right now.
We're not doing a ton with the Nginx systems on this.
So it's likely already served that service and then exited.
And we can see across here, we have a bunch
of different telemetry across their environments, top CPU
processes, top resident memory.
This is all collected by the Ops Agent
and sort of provides a larger fleet-level view of what's
going on with your system.
If I go back to my Inventory, I can
click on this individual system and see
what's going on with it.
I can get a little bit more about the host utilization
for it.
I could scroll down if I wanted to
and actually see the processes individual to this system.
If I scroll over here a little bit,
we can see everything that's there,
and we can go through if we had more services as well.
So let's go back to our Dashboards page here.
And let's say, I wanted to get sort of a better view of what's
going on with my Nginx system.
After all, we deployed this to actually track that Nginx
environment, and we want to better understand
what's available there.
We try to make it really easy using the Cloud Ops
Agent and some of our sample dashboards
to immediately get value and understand what's
happening with those systems.
So to install one of those, I'm actually
going to go to my Sample Library here,
and you can see all the dashboards that we have here.
This is also available on GitHub.
If you wanted to check that out, you can go to that link
up here.
But I'm actually just going to focus on this Nginx Overview
one.
So if I click on this one, I can do a couple of things
from here, but I'm actually just going to preview it.
Now, you'll notice this dashboard
is based on Google's Ops Agent.
So you can learn more about that,
what metrics are available, and you
can go into the documentation to see what's supported.
But for today, I don't need to know everything that's there.
I'm just going to go ahead and import this sample dashboard.
And from here, if I'm not going to edit any longer, which
I'm not, I'm just going to move into--
switch into View mode.
And now, I can actually see, across all these instances,
some of the activity that I've had over the last hour or so.
So we have a really simple spike in request rate,
and that was probably the instance
that I interacted with.
We can see concurrent connections.
We can see the connection rate.
We can also start to see information
specific to the host VM-- so CPU percentage, memory, as well
as Nginx VMs by region.
So we get a top-level view of our Nginx service
across all of these.
And all of these dashboards can actually
be used to mix into other dashboards if you wanted to.
So for example, let's say you wanted
to build a load balancer in front of this,
and you wanted to track the load balancer and the Nginx VMs
across a single dashboard, you could use these metrics
to do that as well.
You could also set up alerts on these
so that if you were having a problem
with concurrent connections, or you
saw a large increase in request rates,
you could do a couple of things.
You could create an alert.
You could convert this to an alert chart
and once a threshold is reached, receive an alert.
Or you could also dig into these more individually
if you needed to do that.
So that's a really quick example of what you can
do with the Cloud Ops Agent.
Today, we used it to--
well, first, we installed it using Ansible.
Then we configured the Ops Agent to look at our Nginx systems.
And then we aggregated that information
across all three systems.
So I hope you found that helpful.
And thanks, again, for watching.