[MUSIC].
>> Hello everyone. This is Sudheesh Narayanaswamy.
I work as a senior program manager with Azure database for MySQL.
In this episode of beginners series we will see
the monitoring options which we have for Azure database for MySQL.
We will check why monitoring is important.
We will also see the options available to monitor the database.
We will take you through how we can configure audit logs and
how we can access them with some interesting demos.
Now let's see why monitoring is important.
Being a fast managed service, Microsoft does monitor your database.
Based on the data collected from these monitoring,
it takes proactive and reactive steps to make
sure your database is highly available.
From a customer point of view also,
monitoring is really important.
You can monitor your resource utilization.
You can monitor your connection and workloads.
You can even monitor what
is happening on your database historically.
Now monitoring all this would help you to take
wise decisions in saving
cost and taking decision on when to scale up,
when to scale down, etc.
For monitoring Azure database for MySQL flexible server,
we do use the capabilities of Azure monitor.
We pump in data into Azure monitor and later using the metrics,
logs, or workbooks we retrieve the data.
We also have Resource Health Explorer,
which actually shows you the information about the health of
the service or health of the databases which you own.
There is also activity logs which audit
the actions which are happening on the databases.
There's also an alert mechanism where you can go ahead
and alert when certain preconditions are being met.
You can even configure it using
action group to send SMS or to send
an e-mail when the alert is been
fired so that you can take necessary actions.
Now, let's quickly check on what we need to do to configure
audit logs and slow query logs in
Azure database for MySQL flexible server.
First thing is, of course, to set
these parameters in server parameters pane,
enable the auditing of slow query logs,
make sure what needs to be audited is mentioned, and
also make sure what is
a long query of time which you would like to configure.
Now for all this configuration,
you would have to configure the diagnostics settings.
In the diagnostic settings you mention
where you will upload these data to.
There are different sources.
One is log index bug space,
another is Event Hub or you can even send to the Azure storage.
Based on the configuration, the data will be uploaded or
dumped to the source which we mention.
Now post that, depending about where you have sent this data,
you can use Azure monitor capabilities
to go ahead and access this data.
Now, let's get into the demo and see
the different monitoring options.
In the Azure portal, if you look at the monitoring options,
in the overview pane, we have a "Monitoring" tab which actually
gives you an information about the different metrics,
very important metrics like CPU memory,
IO percentage, the connections, the query workload, etc.
If you want to go and see specific metrics,
then you will have to go to
the "Monitoring" section and you can select metrics from there,
and then select the metrics of your choice like say,
host CPU for [inaudible] and then see it across
the time what was the utilization for that particular metrics.
Now let's see what are the "Diagnostic Settings".
This is where you configure,
where to send your slow query or audit logs to.
Configuring certain parameter speed, whether to enable,
disable or what needs to be audited or what needs to be collected.
You would have to also select where to send
this information to and that's where
this "Diagnostic Settings" plays a role.
In the "Diagnostic Settings", you can
actually give the name of your diagnostic settings
and then see and configure where do you want to send it.
Do you want to send it to Log Analytics,
do you want to send it to a storage account,
or do you want to send to an event hub?
You can select slow query logs, audit logs, or even AllMetrics
as well to be sent to the "Diagnostic" settings.
Once you configure the "Diagnostic" settings,
the data will be sent to
that particular destination which you have selected,
and then you can pull that information from there.
Now in "Logs", if you go, you can query the data
which had been sent to the Log analytics workspace,
let it be for slow queries or for audit queries.
If you run this query,
this for category slow query logs you will get for
this particular server what are
all these slow query logs which has a query time more than 10.
In this way, you will be able to get a more detailed information
below and to get what is a secret text,
how much time it took, what time it ran, etc.
All this information can be queried.
You can also query the audit logs in the
same if it is being sent to the Log Analytics workspace
by changing the category to
audit logs and running that query to find that information.
This is where you would be able to run the query against
AzureDiagnostics table for the specific categories
and you can pull the information,
whatever you are looking for.
Now moving on to "Workbooks".
"Workbooks" are something which is a single canvas where
you can tap in data from
different data sources which is available in Azure.
When I talk about data sources like Log Analytics workspace,
you can pull that out from armed queries,
you can pull data from the Azure graph queries,
metrics, a lot of other data sources which is present in Azure.
The good thing is that you can bring everything into
one particular canvas and you view that information.
To make it easier for our customers, we have
actually created three default templates.
The first one being overview template which actually
gives information about the server summary,
databases, the connection metrics, performance metrics,
storage metrics in single pane
so that you can have a quick look and identify
what's happening on your server rather
than adding one metrics or the other as you wish.
Now going to the "Auditing",
which is mostly to do with the auditing of your databases.
Here, the top would give you
information over the administrative actions which is being done,
which actually pulls information from the activity logs and then
you will have an audit summary
about what has been audited over that period of time,
whichever you've selected, regarding
the connection audit summary and audit events which will give you
the table access summary or I would say
the trend analysis of the table
access summary which can help you to
identify how your database table access
is happening or the trend analysis can be done for that.
Also, it will give you information about
errors which has been identified while trying to do the auditing.
Coming to the Query Performance Insight,
another thing which pulls data from this slow query logs,
this actually gives you
more information about the slow query trend,
what query it is and it also gives you
the query text of what has been queried and added to it,
it also gives the top five longest queries which is running and
the summarization of the queries on which actually
details you about the count.
It details you about the minimum deviation, minimum query time,
how many times it got executed, etc.
It's a good amount of information which you
can use it and help to find tuning queries.
This is what the performance insight does.
Now let's move on and check on the Resource Health Explore.
This is where it actually talks about if there
was a down time onto the server by any means,
it will be mentioned here.
It will also talk to you about
the availability and other things
which is happening with the health of the resource.
It will be brought into
one single area where you can go ahead and check it.
Now, let's check the "Activity Logs".
The activity logs are where you will have
all the administrative events which is
being run on a service over a period of time.
You will be able to grab those details.
Then you will know what were the successful,
who did it, whether it was a failure or a success.
In this example, you can see I did
a restart of the server 18 hours ago.
There was a firewall rule which I created 18 hours ago.
It can even detail you on the request details like
the correlation ID and all which you can
actually submit to the support team,
which can help you to find out in case
of any failure of a specific action that
you performed and just feel why it feel or what can be done.
Now, coming to "Alerts".
You can either create alerts from
here or using a "Create Alert" button, or you can go to
specific metrics as if it is something related to the metrics.
Or even if it is an activity log of how
you can create alert rule from there.
Here, let me take an example of a host CPU percentage.
If I now click on this alert,
it gives me the condition of the alert
when it meets a specific percentage,
I can go ahead and create an alert.
Let's say I'm giving an example here it's 50 percent.
If it goes above 50 percentage I would need to get alerted.
You can set the evaluation granularity PD,
the frequency of evaluation, etc., on to this.
Then, also, you can create action groups which actually will help
you to send a mail or it will also help you to send an SMS.
You can also use the same alert dashboard
to view all your alerts which is coming in the system.
That brings us to the end of the demo.
You can see the resources which will help you to
understand in detail how we can monitor the database for MySQL.
This is already available in the description below.
Thank you. If there are any further questions,
feel free to write back to us on the e-mail I had mentioned here.
[MUSIC].