Welcome to Microsoft Mechanics.
Coming up on the show we're going to take a look at Azure application insights
that provide a simple way for engineering teams
to gather live telemetry from web apps and services
for real-time monitoring and diagnostics.
We're going to show you how you can proactively detect and diagnose issues,
get actionable insights by machine learning and ad hoc analytics,
and how to set up monitoring for your app
Microsoft Mechanics
I'm joined to by Raul from the Azure team, Welcome.
Great to be here.
So application insights is really a new offering,
but what are we trying to solve for here?
Traditionally application monitoring has been an after thought.
Monitoring would happen and then issue started popping up.
But with modern applications getting increasingly multi-tiered
and componentized,
we need to infuse monitoring in all phases of the app lifecycle.
Ranging from development to test to release,
as well as planning.
So that way you can identify issues and optimization
as part of your pre and post production process
and iTrade continuously.
And incidentally that's what DevOps is all about.
So how does application insights make all of this easier.
Let me show you.
So here I have an Azure dashboard
with various charts and metrics pinned from application insights.
It can help you detect and discover issues
that impact your production environment
as well as subsequently your customers.
Now we are targeting engineering teams
rather than traditional IT Ops teams.
Because we want to give
monitoring and diagnostics capabilities to developers
as they are building their apps and services.
Now as an example,
here they can see both the client-side and server-side performance.
As well as detect failures in one single view.
You also want to ensure that product owners
get that useful telemetry
while they are making feature prioritization.
As an example,
here they can monitor the usage of their applications
and also discover what their most popular pages are.
Also one more important thing.
To reduce areas to adoption,
we have deliberately taken an SDK based approach.
The operations team no longer has to go and install an agent
on a server to get monitoring up and running.
Right, and all that said
don't worry about it if you're in the ops team.
All that visibility also accrues to you,
so you can have continuous monitoring of the application
to ensure that all of its dependencies are up,
available, and the reliability and responsiveness is where you want it.
That's true.
Additionally, by empowering the engineering team
we are ensuring that the job of maintaining the application
becomes a shared responsibility between developer and IT.
So that they can both get ahead of the issues in production environment.
So how would I use all of this?
So I have an application that's already running on an Azure VM,
as well as an Azure app service.
So that's already instrumented with application insights.
Let me show you a simple example how you can detect
and fix issues in production.
Okay, let's do it.
Let's come back to our Azure dashboard
and look at the application map.
This application map gives a topology view of your application.
And shows me all the
server-side and client-side dependencies in one single view.
So in this case I can
for example figure out that some of my server side dependencies are not in a healthy state.
If I want to diagnose further,
let's go to the Azure table.
There are three errors that came up for that dependency.
So we'll find out what's going on with this "Get Customer/Details" problem.
Now it tells me it's a 409 error
happening during a post command.
What might have been going on this in this operation?
So let's see all available telemetry.
Now there is an exception that got thrown as part of that request.
Let's see more details.
Now I can see both the error message as well as details about that error
where it happened in the file, what line number,
all as part of the call stack.
Now I can just file it as a bug
for my engineering team to investigate and fix.
Really cool.
We just saw something really powerful here that
I could detect and diagnose the issue and have the ability to route
that information back to dev teams
to take action.
So they can actually see this throughout the development life cycle.
But, can it help me identify things that might be performance-based
or other problems that will make my site go from slower to faster?
Yes it can, let's get back to the Azure dashboard.
So here we can see both your server side performance,
as well as your client side performance.
So in this case we have noticed that
the server is taking close to nine hundred milliseconds on average to respond.
Sounds slow.
So let's see if you can make it faster.
You can see that my most popular operation here is "Get Home/Index".
In some cases it's taking two seconds to run.
We can go to the profiler and see what's going on there.
So the profiler gives me a thread level view
of my request.
And it tells me that this particular request
was spending most of its time being blocked on a particular operation.
It gives me a couple of performance tips
that I can then take it off and make my site faster.
Right now if I wanted to drill deeper into that data
and find trends that might lead to performance issues like what we saw here with the root causes.
Or even deep dive into historical data.
Can I do that and track those root causes down?
Yes, for that you can use the analytics and smart diagnostics capabilities.
So that's basically a big data query engine that we have built with an admin site
that you can use to drill down into your application telemetry
and get instant answers.
So to go to the analytics portal,
we just have to navigate to analytics from the appication overview blade.
By the way, on the home page
you would notice there are a bunch of examples and tutorials
that can help you get started
with some of the basic and advanced queries that you can run with application insights.
Super helpful.
So in this case I have a bunch of queries already set up
from one of our past analysis that uses machine learning to identify problems.
So we have been regularly monitoring our exceptions
in this particular application.
So we had a query set up for that, let me run that for you.
Now you'll notice that in the middle of January around the 12th,
there were some exceptions that started spiking up.
Looks like something bad happened there.
In this case our hypothesis was that it might have been due to an increase
in the request node that might have caused this problem.
So we had another query that monitored the request for this application.
And interesting to see there is some correlation happening here.
A lot of correlation, yeah.
So to figure out the probable route cause,
we can use the smart diagnostics capability that I mentioned earlier.
That basically runs machine learning algorithms
in the backend.
It discovers patterns and kind of suggests the most probable root cause
that might have led to the spike or the dip.
Is that what that purple dot is for?
Yes.
So if I click on this purple blip
it will run those algorithms in the back end.
It immediately tells me that there were some malicious requests
that originated from this particular IP range from St. Petersburg in Russia.
And those spikes were because of that request.
So simple fix is from a firewall.
Sounds like an easy fix.
And these types of queries and insights are really in the underlying data sets that we have here.
But I could see that some of this would be really useful in terms of building out KPI dashboards.
Maybe reviewing that with the broader IT and dev teams.
Is that something else we can do with the data?
Definitely, it's very easy to build these dashboards using analytics.
So once you have that query that you want to monitor regularly, written out.
You can just pin that to an Azure portal dashboard
that we saw on the Azure portal just now.
Or you can export that to Excel or Power BI.
And incidentally that's what we use to monitor all the app and sites KPIs internally as well.
So how would I actually get this all set up and running in my own tenant?
So we wanted to infuse monitoring in all parts of the application life cycle.
So we have designed application insights to be a part of Visual Studio.
And have also built it into most of the popular Azure services.
If your application is already there in Visual Studio, you just need to right click on that application,
add application insights telemetry,
and you can start collecting all your data without needing to write a single line of code.
Very cool.
And in case you have your application already running in Visual Studio,
you can see live production telemetry data
while you are working on the code as part of the code lengths integration.
Another thing, so if you are developing your application using any other IDE
or any other language or platform.
We have most of our SDKs available on github
that can help you get started.
Very cool.
Can I use application insights when my app is already running in production?
Maybe I haven't developed it like we see here
during the app development process.
Can I port that back to an existing app?
Yes, you can enable application insights on a service
that's already running in production using a status monitor configuration tool.
This automatically captures all the applications that are running that.
And you can enable monitoring for them with a single click.
Of course you'll get much more deeper telemetry and advanced capabilities
if you build your application from the get-go using app insights.
It's really great stuff.
Can I integrate application insights then within my own existing tools and processes?
Yeah, so application insight supports continuous monitoring
through your entire dev ops life cycle.
So we have various touch points that you can use to integrate with your own tools and processes.
For example, we have data access REST APIs
that you can use to get all your events, metrics and queries.
You can even continuously export your data to a block storage
and run stream analytics on top of that.
We are also fully integrated into Azure Monitor.
And you can use it as part of your operations management suite.
Also we saw before,
if you're using visual studio team services or github
you can use application insights as part of your work item management system.
As well as with the release annotations and cloud node testing.
Great stuff here, thanks Raul.
We've been covering a lot on the shift to modern application architectures
and this really makes DevOps real.
Where can people go to learn more?
So you can learn more and create more for yourself by following the link below.
And also don't forget to keep watching Microsoft Mechanics for the latest tech updates across Microsoft.
Thanks for watching.
Microsoft Mechanics
www.microsoft.com/mechanics