Monitoring and Troubleshooting with Azure Application Insights

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] so [Music] hi everybody thanks everyone for joining the session today and today is going to be all about azure application insight i have here with me chris uh and for the next one hour i believe chris will do a kind of good deep dive into this nice subject uh yeah chris if you want to do a kind of quick intro about yourself and then in few minutes i will share your screen and then i believe we are ready to go uh sure um my name's chris ayers um i like to tell people i've been programming since second grade since i got our first computer and i've just never looked back i've done it my whole life um just exploring different languages and programming concepts and i've been in.net since 1-0 i've been in the cloud for for many many years back when it was asm and cloud apps and cloud services so i've been in the cloud space for a while and you know i've had to do everything from low-level debugging to trying to figure out what's going on with complex systems of microservices and containers and in my journey i came across application insights and just fell in love and i've leveraged it in a number of companies and as i've i went into consultancy and i was a consultant um we helped many of our customers and clients uh integrate application insights and figure out what was going on with their systems and now that i'm at microsoft um i recently joined uh microsoft uh about a month ago i'm on the what they call the fast track for azure team which uh we're part of azure engineering we make the platform better but we help customers and remove roadblocks and um i don't see my use of application insights or log analytics going anywhere at all i i i think it's as relevant now as ever and i can't wait to show you guys all the features and things that it comes with okay great uh yeah just before we officially start i would like to ask everybody watching this session now just do a quick registration the link is in there if you could just type in the link or just scan the code that would be quicker and then that would be nice for us just to get a better understanding who is joining our sessions and we can always share let's say to keep our motivation to keep sharing our knowledge as well and then on top of that as you can get some additional microsoft microsoft ireland is our official sponsor sponsor in microsoft throughout that link you can get some additional information on top of everything chris is about to is about to share uh i already say chris and i kind of already agreed uh if there is any questions let's make a very interactive session if there is any question from your site guys just you know type in and then i will make sure that we will stop chris read out the questions and hopefully we can have a really nice session tonight i think we are ready to go chris i will share your screen and then i would say the flower is yours let me just add your screen here uh yeah it's there and then chris anything you need i will be here on the background and but now you are the guy to to drive this next hour i would say okay so we're going to talk about monitoring and troubleshooting with application insights um and some of this can fit under an umbrella of observability but um i'm i now work for microsoft i'm a senior customer success engineer there on the fast track team um hey reach out if you have questions you find my twitter i'm on linkedin uh i've got a blog and i got a github repo and actually a lot of these sample projects and even infrastructures code and pipelines to build and deploy them are all checked in at github so i'm going to be leveraging those for my demos later but we're get we're going to cover what is application insights the sdks like what we can do with it the languages the the functionality of the features i'm going to hone in on one specific area telemetry processors and initializers and kind of talk about what they are and why we might care about them i'm going to do a big demo we're going to be looking at multiple projects we're going to be in the azure portal we'll be looking at live data we'll even do some console stuff because application insights is not just for azure it's any cloud on-prem anywhere as long as you can talk to the cloud you can observe it and troubleshoot it so let's start out with what is application insights it is a type of tool called an apm an application performance management or application performance monitoring tool and what this does is it pulls together a lot of different sources to give you a more holistic view of the system so it can take application traces it can look at system level metrics like memory and cpu performance um and users like what sessions you know how many sessions are you facing um what's the browser performance like how long it takes to render the page or do requests are there errors in the system and then dependency you know so if you're calling out to a database or another web app it's taking two seconds do you see that and do you know that that's happening so that you can have a more holistic view of your system the way it works is in azure there is metrics and monitoring that's pulled from the back-end services web apps you know pass services sql all of those can feed information into app insights and it's done on a like a background thread so it really doesn't impact performance of your system you can add the sdk right into your source code that way you have more control over reporting uh individual page views interactions events and there's even some javascript components that you can include in your front-end web pages and applications so that you can see how long pages take to render or requests take from the end user experience this is one of the things i first saw when i dived into app insights because i've seen people try to implement like global window handlers for errors in javascript and it can be painful um you can pretty much get to add a line or two of code into the front end javascript and you're able to see javascript errors that are happening on the client all of this feeds into app insights and that drives alerting you can export it to power bi you can while you're using visual studio see errors that are happening in the methods and end points that you're working on in visual studio and then go right into the app insights data to see performance or error data um you can query it against rest apis and then there's artificial intelligence applied to it and it can learn if you have maybe memory leaks or abnormal behavior or abnormal performance so it it can be proactive as well as reactive um out of the box app insights works with c sharp vb java javascript node python so there are libraries and ways to call it there's also just rest endpoints that you can send some of the data to it works with logging frameworks across the board and it integrates like i said data from azure monitor so it can read from the underlying azure platform now it works out of the box so there's three sections here and i just want to touch on them that first one is let's say you have code out there running in azure and you don't want to change your code you can actually for a vm or scale set an app service an asp.net app you can go into the app service and click a button to enable app insights and it will take care of it for you you don't make any code changes and it will enable app insights to to send you know monitoring and troubleshooting data to an app insights instance so that you can analyze that and interact with it with zero code changes it's really cool and i'm going to show you that you can add in the sdk so for net that might be adding in a nuget package or two and you can see we have asp framework we have asp core there's integrations with app center so from mobile apps some of the xamarin apps through app center you can get information pretty much you can see uh the wide range of support that's there through the sdks and then you can export out that data to stream analytics or power bi so you can do advanced reporting and alerting and app insights has actually been evolving quite a bit and it's really integrating very closely into log analytics and log analytics workspaces so we'll we'll touch on that as we get into the demo um and here's a couple of the bits of data you can get from your running applications i mean not just uh it's up and i can see a web page but you can see request rates so are you getting hundreds or thousands of requests a second what's the response times how many of those fail um you know what about our calls out to dependencies other endpoints uh blob storage sql what do those response times look like are we suddenly seeing a spike in failures from our dependency what about exceptions um are we getting weird exceptions um depending upon how you configure it you get full stack traces and it can really help you isolate where in the code something's failing so that you can home right in on it um on the browser side how long is it taking the page to load so you have components or or asynchronous calls that are are waiting and it's inhibiting the rendering of the page um so you you can track all of that and it really gives you that like i said holistic picture and then you start adding additional information around just what your app is doing how many users are are currently interacting with it in sessions um what specific counters maybe we have some cues or message bus information you know and we're processing messages we can integrate that in uh maybe for some of our app service plans or even containers and kubernetes is there like a spike in cpu on that host or memory usage if something does fail can we get snapshots and diagnostic trace logs and then for our information we can make our own custom events our own custom metrics using the sdk and we can log that information so maybe we're we're trying to do a marketing funnel to get people to sign up for um the website and so maybe we're tracking that they visited and then we have an event that they started the sign on process to to create an account and then we can track if they fall off or if they keep going down and i'll show a couple of those examples as well on the site this is where i i'm gonna i'll show you this out in the portal but just a quick overview of all of the features that are available at appvid sites and they're extensive there's so many you start looking at oh i could use that in my app so smart detection um this can trigger alert groups which very much like azure monitor log analytics so you can have it do um ims or you know teams messages or emails or text or calls this will start learning the patterns of your application and so it can start detecting if things fall outside the dorm you have this growing memory usage and it might predict that you have a memory leak you start seeing an abnormal rise in failures or certain you know you just have different performance or interaction patterns and you can see a couple of examples here like abnormal rise and exceptions insecure url access insecure data transmission so it can give you recommendations proactively about your application or before it cascades into something bigger this this one's really cool as you start having distributed applications and you have multiple dependencies accessed over the web or sql or you know whatever this will actually start to learn oh this node talks to that node um and as you can see it generates out a map of where things are calling you can name the different instances or services you can see um like the numbers of calls and the failure rates how many instances are running and where we probably need to focus some of our attention on something failing it's a nice holistic application map that can give you some interaction understanding that you might not be aware of i i find this one is when you start having a lot of nodes and services running together this is a really cool feature the other nice thing that you get out of the box with app insights is telemetry correlation so in my career we've definitely tried to implement our own logging systems and we've definitely tried to go hey i'm going to put this id on the front end call and pass it to the back end call app insights handles all of that for you it knows about parent operations and dependent operations and has overall telemetry so you can hone in on one request and see the entire chain of events that are generated by that being calling multiple services triggering custom events in your code to responding back to the customer or client so combined with this it's super powerful there's profiler so you can enable profiling and this kind of randomly runs every once in a while and will try to identify hot paths in your code you can see in this example here where it's it's looked through you know where some of the the calls are this was calling out to table storage some blockages and it lets you kind of hone in on the average times from 300 milliseconds where it spikes up to like 1900 so you can focus your effort on the places it needs to be focused instead of doing kind of micro optimizations that might not help there's some really cool usage stuff around the ui in the front end where you can see how users interact with different pages and parts of the system you can try to correlate you know what effects what what things affect retention and you can go hey for the users who did this and then did this other thing what kind of maybe affected like page speed does page feed affect how long people interact with the system or um on the right here i think this one's awesome and i actually used it at a customer they had built an interface for users to interact with their site and this was where you added a lot of items into a like a request and you might go into a detail screen to set a field and then come back out but they had this like quick edit grid and you could edit some of the common fields and we implemented app insights we were looking at the user flows of how the users were interacting with the site and we kept seeing them select a row go into the detail come back select a different row go into the detail and so by looking at the behavior of the users how they interacted with the system we were able to find one or two fields that if we added it into our quick edit screen into that bigger table it would save them a lot of clicks and page loads and they would have a better experience and so we did that and the user flow was dramatically different they were they were going edit edit edit edit submit and they were able to process their data quicker and they had a better experience and so this um this kind of feeds into that devops story of build the the features your users are using or or will use don't build features that people might not spend a lot of time on so you can focus your efforts you can look at all the telemetry so you can search like i want to search for trying to hit a certain url or i want to search for dependency or maybe i want to look at requests from firefox versus chrome versus edge i want to look for maybe a an sql dependency or hey we had an incident last tuesday at 4 pm so i can hone in on that time and date and try to view exactly what was happening during that time it's it's extremely powerful and then this ties into a lot of the log analytics work um you can again dive into specific metrics and you can overlay multiple metrics together so that you can kind of see if there's correlation between things using all of those charts you can build up dashboards so you can have a holistic view of your system you know the usage reliability responsiveness this is what i was talking about with what's happening in the browser about page load um and app insights can work effectively with like azure devops where you can tell it um hey version two is out so you can start looking at differences in performance between maybe version one and version two and version three so that you can continue to improve your application over time and this one's another super awesome feature you can get a live metric stream of everything happening in your app um this can be a live view of your logs requests uh cpu i'm going to show this but you can even see instances so if you have four or five nodes or instances of your app all running and you're seeing some behavior you can actually filter it down by server to see if you can identify a bad node um you can you know like i said see the sample telemetry here so you could see failed dependencies or requests this one is super awesome and i'm going to show it to you because this works like i said on prem multi-cloud in azure um back when we had offices um it was not uncommon to have this up on one of the screens uh in our uh our work area to have a live metric stream up so that we could see things in real time so these are some of the features i just wanted to cover them real quick i'm going to show them live i'm going to dive down to the sdk feel free to pop in and ask questions if if something doesn't make sense or if you want to know more about something i can probably dive into it as we get into the demo so i mentioned that sdk earlier that works with so many different platforms and so many different technologies so in azure like codeless zero changes to your code base you can get that on app services functions kubernetes vms and on-prem you can do this with windows vms there is a module that you can add into iis and it can enable gathering those logs and request information and telemetry to send up from that server up into azure so that you don't actually have to change any of the code this works in net and core java node.js and i i realize um this was dismissed the update so dotnetframework.net56 and and.net core this works on all of those but when you start adding in the sdk you start adding in the code we now get some of these features over here where you know maybe we're in a single page app and there's not a lot of requests back to the server um so there's you know javascript you know we can add in a react angular view hey we're going to do a page view as we we change routes in our front end maybe on the back end as we're processing things we want to track an event uh maybe we're we're sending a request off or something or or they did a thing in the system placed an order signed in signed up um maybe we want to do metrics uh you know if we have a large queue of if it's that we're processing maybe we want to report on the queue length to see if we can start seeing some correlation between cue length and performance um maybe we have an exception now there is a global exception handler but maybe we want to explicitly track some exceptions in places um so that we can generate that telemetry on that we can do specific requests specific dependencies or we can just capture log messages this can give you such a holistic view of your system by starting to own the data like you get a lot of features out of the box but it can add noise if if you don't um like maybe if you have a single page app and you're not tracking page views you see a lot of just index index index so adding in track page views you can now start having some differentiation when they're on different pages you can see a lot of requests but maybe you really want to highlight certain events or you really want to track certain dependencies or calling internal code methods that aren't external dependencies but maybe they're code dependencies calling into a library to do you know image processing or some other type of functionality you can track that and this makes you really want to log all the things i mean that's one of the the great parts about app insights and apms is you want to log all the things so you can put the data together into this new view of the system and it does that it does lead to a question how much does this cost so a lot of the pricing is based on ingestion um sending data into the system you also have capabilities for tests i can ping if my site is up and i can ping from like uh apac asia i can ping from uh emea i can bring from different cities in the u.s i can also do multi-web steps uh multi-step web tests try saying that three times fast um where you could say i want to log in i want to add this item i want to check out you know you you can you can do those though there is an extra little cost on that you do get the first five gigs free and then there is additional pricing per month this is all available out on the azure monitor pricing page i'll show you guys that later but it's very cost effective but let's say you don't want to log all the things maybe and something i found in my career is you don't have to log 100 of data all the time what app insights is really good at is identifying trends so maybe when you first do a deployment you do log 100 of things so that you can start catching errors and then as it's been in production we start lowering maybe those percentages to fifty percent we only want fifty percent of the telemetry we don't need every request just kind of half of them now if there's an error it it does capture the full request anytime there's an error that overrides any setting but for just all the normal good traffic maybe you only need part of the request not all of the requests excuse me so that leap that brings in sampling there's some capabilities around sampling so that you can control how much of that data you get and don't get um just buy out of the box whoops out of the box when you enable the sdk it does something called adaptive sampling and this will adjust how much good traffic gets sent up to app insights um what's really nice about this let's say you have a browser talking to a back end or a series of services what's really hard if you roll your own is hey i want to limit some of my telemetry you might get only the front-end request or only the back-end request it might not grab both parts of the the end-to-end request app insights always make sure that it has the full request from front end the back end and everywhere in between if you filter out part of it like you either get all of the requests or none of the requests so that you always have a full picture of what's happening um you can if you don't want to do adaptive where it will increase and always send errors and decrease as need be you can say specifically how much you want to send and you can you can specify some sort of rate you know i only want to send x per minute or 10 percent something like that and then finally in the app insights instance in azure itself if you don't do anything um you can tell it to discard some of the telemetry now this this if you say fixed rate or adaptive in code specifically this won't happen but if you have just enabled it on an app service or a function app and then you go into the app insights instance you can tell it hey i only want 20 of the the data coming in or 30 and i'll show you this too but these are effective ways to limit cost because you know you're really looking for trends um you might not need every single request ever when you're trying to troubleshoot or detect something is happening and telemetry processors and initializers i mentioned those at the beginning these help that telemetry be more meaningful um you can modify any sort of telemetry going back to app insights initializers are usually the preferred way to modify a request where we're saying hey i want to set this field to have this property i want to add in oh it's an admin user versus a premium user i want to add in extra information about this request that's where telemetry initializers work great that's what they're and they usually run first telemetry initializers always run before processors and we'll talk about that difference processors are used for filtering so we we can say i don't need to see that request for some reason maybe you know you have a bunch of images uploaded to your site and occasionally you'll get 404s and you just don't want to see those in your logs you could write a telemetry processor that would say hey if the url request path has slash images and it's a 404 don't bother sending it and that way you can save some of your ingestion so initializers like i said add modified properties always run before processors they can be called more than once um though typically you don't modify the same property again chris can i ask just a quick question yeah i have i have a comment here from andrew um saying dashboards and telemetries are very useful features things to know about yeah that's true just a quick question actually from me let's say from what i do in my day-to-day is all about security and changing parameters and all of those things and then depending the configuration i do it can takes two hours can take you know 24 hours or 72 hours in order to do all the replication into the kind of microsoft data centers and then eventually to become available uh let's say if somebody has started an application using you know the full telemetry you know collecting absolutely everything and then good tip from you after a while kind of you know adjust the system uh if you make a change does that start straight away or there is a bit of kind of delay in order to to that thing to happen no that's a great question um so like if i start a new application right now and i have app insights in it i can go out to azure and see the data within five minutes um when you make that adjustment uh it's pretty instant it's very and i will show that i'm going to start an app and we're going to have no data and then i'm going to start an app and we'll see live telemetry and we'll be able to explore so i'll dive into that in the future okay thank you no no problem um like i said uh back to telemetry initializers this is where we can add and modify extra data or existing data on a telemetry request it's really cool they always run for every item and you use this to enrich properties so initializers add extra data to our requests processors these let you replace or throw away an item so it this is this is a gate like we want it or we don't want it and um this is just like normal like middleware they they run in an order and so you can you know if one throws it away it won't process out to the rest of them um so if you if you throw away a telemetry request nobody else sees it after you and i have code i have links we're going to go through that i'm going to show you um but these are deeper features that i think people need to be aware of to make full use of this platform we had all those requests about track uh events and page views telemetry processors the other part of it so what are you guys are waiting for let's go look at some code let's go play around all right so i have um a resource group i've got some am apply app insights instances and i have some web apps here now this is all actually out in my repository out on github and i have just that this was set up in net5 this was literally net new web app okay very simple app um you know this was the before the the minimal apis from net six you know yesterday you can see it's just normal stuff there's no mention of app insights anywhere in here and so if we are to let's say we go out to my basic site this is my basic site i can click around it works fine nothing's happening to it and just to show you i i don't have app insights on right now it's not turned on so what i can see from my system is i can see a little bit of data in and data out and response timing requests these are just provided by the platform the app service knows if you're sending out requests or not sending out requests and how often they come so super basic that's not fun though i i want i want to see some telemetry well i have another one so let's take a look at the second one this one i it's the exact same app i just did one thing different i enabled app insights and so again same basic site but but now that app insights is enabled it uses an instrumentation key those are how requests get sent but we can start seeing our app map so you can see hey i have my url i can see my details on it there's one instance it's had three calls i can see performance information the profiler's been talking to it i can look at smart detection right now there isn't anything just fine but you know out of the box it looks at slow page loads and here let me let me do that slow page loads slow response time or dependencies something degraded or something is a potential security risk these are things that you you kind of just brought up a little bit um let me go back and close these whoops to me too many blades over um this one's one of my favorites like i said live metrics you know so if that site isn't running so you can see that there's a like a server under the hood um you know as i'm clicking around and doing stuff that that's happening on the back end um you can see that the incoming request rate went up you can see the memory that's committed on this thing um super basic i don't have a lot on this site but i do have some demos that do have more so we're going to look at that shortly search so it's now called transaction search but see i can see requests you know a dependency call out to the performance monitor i can see some custom events um i can see requests coming in and and things happening the profiler ran um individual logs and i can filter this you know there's a lot of requests i can look at um dependency performance you know maybe i'm really concerned if it's over 200 milliseconds which in this particular case that's not a problem so let's go look at maybe request performance and so now i can see some of the options that one's that one looks kind of scary that one took a while getting the library and so i can see what requests specifically might be causing this now this is just a search there's a whole section dedicated to performance which we'll dive into but this is what this is what's really nice where you know if you know you had some sort of incident at a certain time you could go and look at that specific telemetry or you can just drag and drop it and then you can hone in on what's happening and see those specific events and requests this thing is amazing and then there's this button here viewing logs i kept mentioning the interaction with log analytics well this gives you that custo query language where you can really dive into the requests and and see what was happening um we're going to come back to it but that's a super awesome feature where you you can use this gui if you need to to configure a query a certain way and once you have it how you like it you can then view in logs and and you can see it has the date times already written for you and it has all of the things that you kind of selected so it's it's just a cool tip um you know i mentioned those ping tests and those web tests we'll see they have these here so there's now a classic test and a standard test and you know is it and and maybe i need to just give it my url okay crazy if you don't mind i have another question i'm kind of learning a lot i am learning a lot i need to say yeah maybe you mentioned but i think i missed that for how long all these logs are available and if a company is looking you know for compliance and eventually they need i don't know for three years five years can we configure that out of the box 90 days but again this is not um this feeds into here let me go here so this is the pricing for azure monitor and log into links this is the pricing it uses and so there is that log data ingestion and the price goes down essentially the whole data that you capture um but the retention is 31 days you get 90 of sentinel or if it's app insights data and then you can you can retain it farther than that you can also export out your data so you could stream it to a storage account or an event hub and then you could do a hot cool archive promotion of your data in a storage account if i yeah if i export from there to another storage and then at the end i just pay for this storage and then i can keep for forever i want okay yeah so that that's a functionality um i i can show you down below some of the uh the export uh functionality that we have okay great yeah all clear yeah okay thank you very much again so um no problem that's why we're doing this to talk about this stuff so you can see i added this this availability test is it up and it's pinging from around the world just to see if my site is up and it's giving me the availability and the duration and you know if i go back to um like my app map you can see oh app insights is maybe pinging it i can look at transactions this might take a few minutes again with the the site you know see i'm on edge you can see that's detecting and i can click on a transaction and you can see oh there's some bad js what is this reference to bad js in my site.js um you know i i can see that there's some sort of error so if i go out to my code um i had forgotten i did this to be honest i had added um into my site.js just a reference to some bad javascript um the site looks like it's working fine you know and maybe if i hit f12 and i open my dev tools i might see hey there's this reference here you know as a user if they're not doing that and the site looks like it's working fine you might never see that javascript error i had completely forgotten i made a forced error and i'm seeing hey the user's experiencing bad javascript and it's in this file and so i can now troubleshoot customer browser errors just by seeing their requests i've forgotten that so like that's how cool these these features are and so you know we looked at availability tests now i can look at errors and so there's if there's errors in operations maybe if there's errors in dependencies or there are exceptions in the code you know what type of issues are happening in the this gives you that area of focusing on on on errors and there's server errors and then there's browser errors so you can see when i look at browser boom this one pops up like right away and it's happening in an edge browser so i can tell if it's a firefox chrome a safari edge and i can just yeah so this this hap this is happening over and over again and i can go right to the the exception and i can now troubleshoot my app on both the back end code and the front end code from one spot i i just love this um performance so you can see you know when it first starts loading up you have little spikes maybe in requests but this breaks down the scale like what is my zero or what's my 50 percent my 95 right where is the common places they're coming from i'm coming from tampa this will not give ip addresses that that violates gdpr so you if you ever look at ip addresses they're always zero but it can kind of limit to a region just to kind of give an overall um yeah you can see normal result codes normal performance buckets what's the instance what's the role name which depend um dependencies do i have quite a bit of you can see the breakdown and the count of requests so maybe you start getting uh you know people are hitting bootstrap over and over again um this just helps you explore your app to figure out what are the things that you need to focus on and pay attention to you know when you first start out your app maybe it takes it a while um same with the browser um again same type of details there and then the dependencies which i don't have so right now just enabling this you remember all i did was um i turned on app insights for this site i forgot to actually show that i'm sorry um let's say we go back to our resource group and we go into how we got there i'm sorry how we got there we go down to configuration um you can see there's some value set i didn't set these by hand these are set by just going into app insights and saying enable all you have to do on any web app that you have out there really is just go to enable this will guide you through do you want to add create a new instance or point at one and then yeah recommended it it starts doing stuff i want a profiler snapshot debugger so an exception happened in the cloud and then i can download the snapshot and see what happened and i can see my sql commands troubleshoot yeah i did this through infrastructure as code but you could easily have just come in here and said enable and we're getting all of this data just from saying enable we haven't changed the code in any way this is all being done because the web app added the instrumentation um they do also give you some troubleshooting guides so if we look at request failures this has a number of like so we don't have any real failures on the back end but this has a series of queries uh looking for for problems uh let's look at performance counters that probably has a little bit better so yeah you can see we can set thresholds this gives us like a little series we can start trying to look at what's happening in our system so this has some really great queries kind of pre-built for you that you can dive into let's say something does go out of whack you know let's say our errors are happening uh multiple every second what we can do is we can set up an alert rule so we can say hey on this resource let's add a condition here we go so maybe our server exceptions you know when we can look at it right now everything's great but let's say when it's greater than uh you know five over five minutes i want something to trigger and you can see that this is just an alert rule normal estimated cost and maybe i want to add a an action group so my action group could be something i create and the actions might be you know do a run book reboot the machine it could be trigger this function could be do a logic app or a web hook maybe i i wanted to you know call me or do something i might trigger that through a web hook or through a function so i have all those capabilities to alert me that something happened i talked about the metrics earlier here you can start overlaying metrics with themselves so you know you want to look at browser page load time with cpu processing time for that request for maybe asp request rate so you can this is what you can use to start making some of those dashboards and then you could maybe copy a link and share it with someone and then go you can you can track uh and build metrics to explain what's happening um yeah and you can see here availability it has some pre-generated things that kind of have tied them in and take you places so awesome stuff um i'm gonna dive into this a little bit more later but i kept talking about app insights and log analytics um you can see that that some things are starting to change um they are moving app insights over into log analytics but that's not going to happen until 24. um you know we we can we can see that it it can look at all these queries and start trying to give you multiple charts in this workbook to focus on different areas of performance different areas of troubleshooting there's a large number of things to dive into to play around with so um i would say explore this but but this is some really cool stuff um and i'm sorry if i'm going a little quick there's a lot more i want to show yeah so you can track users and you get insights about them like how many sessions or events they do and what their performance experience is so you can start getting an indication of trends that your users are experiencing you know looking at what their sessions were and then let's say you start doing custom events i didn't make any custom events so these are events that it's automatically tracking like hey you're going to the home page you know or you're getting slash and so those are events that it automatically detected those events can feed into the funneling i i kind of mentioned this as like a marketing funnel but this could be hey i want to know if somebody hit my homepage and then i want to know if they went to like the policy site and then you could you can review this and and see how many people did that and if they're doing a fall off and you can look at your conversions so this can give you some marketing capabilities and here this is just so cool this one really just is so cool this is a bad example but my event was i hit the home page and so then it went to get privacy and started downloading some javascript some minimal you can see what happens as people interact with the site and then they give you some capability to make cohorts so you can group people authenticated users people that are engaged daily long sessions so you can go and look at performance and interaction data based on how that user and those user sessions play with each other and then you mentioned specifically about costs with logging so you can see my data trend so far i've sent up about 800k you can see your data ingestion your pricing your steps your estimated usage and here i talked about the default sampling rate is made to capture everything well i can configure a daily data cap so i can limit how much is going in i can click this and change it maybe to 12 percent and hit okay and it'll start filtering it'll start doing less that'll take effect right away um so all of those are capabilities um we asked about export so we can add a storage account now this one um again whoops they are starting to deprecate um this functionality because they want you to upgrade to a a workplace based insight um i have an example of that i'm going to try to get to it real quick but this capability you can still do as it says from powershell and you can export it so let me look at the next demo real quick before uh run out of time so sorry about that um uh yeah chris just a quick reminder remind that we have eight minutes to go yep no it's fine so let's say you're wanting to add app insights into the code well there's a couple things you can do and i'm gonna show you two ways i'm going to show you in visual studio and in visual studio code so if i just have that same app and i want to add it there's some app insights nuget packages that you can add and i'll show you where to do it in visual studio in code it's like dot net add package reference what this does is you can see in the startup add app insights telemetry that's what it adds if you have configuration there might be a section here for app insights and configuration but this will read that instrumentation key and set up listeners for all parts of the system so that you can start calling the uh the app insights this is how you you do initializers and processors and i have some examples of those i know we talked about them real quick so an initializer you know we want to operate on every piece of telemetry so you you can get your telemetry you know if it's a request telemetry i could add who the user is if i wanted i can also add properties this is this just a dictionary and so i can add any property i want under that request and every request afterwards we'll have is demo true same with 400s maybe i'm i parse out the response code of a telemetry and then i want to manipulate it maybe if it's between four and 500 i say it's it's a success but we overrode 400. and we've added that property um i mentioned filtering so maybe we have a filter that's based on telemetry processor you can see it gets the next processor remember i said there was a chain of processors well maybe if i don't want to send this i want to filter this out i just return and i never pass this item onto the next thing to process you don't have to do any of these filters you can if you want this is really the only thing you have to do on the back inside now i i kept showing you guys how awesome the front end code was this little javascript snippet this comes from microsoft.applicationinsights javascript this adds a little bit of javascript into the the header of the site so if we look at this site and we just do a quick inspect i know five minutes you can see in our head here and i will make this bigger there's a script that get added automatically by azure for app insights dot js so this script gets added into the request going out from the app service and that's what what registers and checks back the information in this request i'm doing it myself into the app insights into the the layout in visual studio it's just as easy you can actually go into connected services and you can hit plus and you can say app insights so there's two options this one just kind of sets up some stuff locally but if you do this one it's really cool uh let me remove what i have here and i'll re-add it just to show you so if i say add app insights if you log in you can then tell it hey i want to i want to point at that app insights it'll set up connection strings it can store it in your local thing it'll add in the nuget packages it'll you can see it even can make an arm template if you want to deploy it out that gives me the capability you know it's all wired up and ready to go since i'm running out of time i will say the documentation is amazing so if i if i just app insights getting started what is app insights right here on docs microsoft it goes through everything they have sdksfor.net and how you get started you can just add in the nuget package talks about right here and there's the add telemetry you can if you need to you can put it in your config file i usually don't i i just do that right in azure but you can also do it as a environment variable or normal secrets you can do logging and integrate in with the logger there there's the auto instrumentation is what i talked about with the zero code and this now uh supports open telemetry so it can integrate with open telemetry all this stuff's awesome i i love it and the documentation is phenomenal so i highly recommend checking that out i think there was one other thing that i wanted to say which was uh the sdk so um and i do track the tracking sdk um it's in that same documentation under advanced the this has some really cool stuff um you can see there's stuff here on exceptions and long-running tasks oh that was the thing i want to show you that reminds me and and then that'll be the last thing so sorry about that jack the very last thing is i mentioned it works on-prem or in a console so i've got this ai console and i'm gonna go into live metrics and i just want to show you nothing's running um i've got my app here which is in uh link pad and i'm gonna have a background task and i'm gonna have some front end tasks and here's my sdk um then i can track events or track dependencies and you can see stuff's running well this just connected you can see my background task is processing and i've got test events not running in the cloud i'm running locally and i can track this so if you're running in a data center you can do this too running in containers you can do that so um thank you guys so much for your time i'm sorry i used every single minute um i like to talk that's fine yeah yeah i can see you are you are really enthusiastic about all these solutions and i kind of impress looking when you showed the events the amount of information available for you to to get a good understanding about what's happening uh with with your with your system is just amazing it's brilliant yeah so yeah so here i was tracking a dependency and i said my dependency target and if i look in my code my dependency target so i i can i can track individual events i can track individual dependencies and requests it's very simple to um yeah and okay yeah maybe probably you we need to bring you on board again you know next year 2020 at some stage there's so much stuff you know to show that's brilliant yeah uh okay uh just adding my code back here again i hope everybody enjoyed like me you know this great uh session please remember next week next wednesday we are back in business again it actually next week is going to be connected enough with some things chris just showed to us next week is going to be all about azure cost management i know sometimes especially you know the companies if they are not in the cloud yet they are always afraid in terms of you know how they can have a good control about the cost they don't want the cost to go up to the roof and then anyway this is why we are running these weekly sessions and hopefully everybody can can join us again uh i think that's chris any final word before i finish the session no uh try it out even with five gigs free you can try it out locally and and uh play around um thank you for having me and and thank you for letting me share my my passion for this okay i hope it helped oh yeah yeah it did a lot i would say i actually looking to change career maybe i will leave the security world and go into follow your footsteps okay guys thanks very much everybody from home for joining us and spending the last hour with us and all the best stay safe and stay connected thanks very much chris again for all your your good presentation thank you okay all the best
Info
Channel: Cloud Lunch and Learn
Views: 9,412
Rating: undefined out of 5
Keywords:
Id: TV1u6UoBRwk
Channel Id: undefined
Length: 61min 41sec (3701 seconds)
Published: Thu Nov 11 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.