all right are we on can you hear me
yes super thank you
nice how are you doing last day I went
to see
been good
like it
go to the party last night
good to see you all here or like see I
can see like the front two rows then
there's like just lights
um welcome to monitoring and alerting
like a pro with Azure Monitor and
application insights
uh my name is Stephanie good sir it's a
mouthful
Icelandic I'm going to tell a little bit
about myself I am a senior software
engineer at CCP games where I work on
EVE Online
I've also been a Microsoft MVP in
developer technology since 2020
and I may have a pinponed code
maintainer I'm assuming most of you know
what have been found is is there anyone
that don't doesn't know what it is
right a few people maybe got some
stickers in front you can confess them
afterwards
I have a Blog a secure code if you want
to scan it you can find me on Twitter as
well
but if we get back to the subject what
is as you monitor an application
insights these are
the official Microsoft descriptions of
them
as your monitor is sort of like the
base layer that application insights
built on top on
like just to put it simply it's a it's a
service that helps you know what your
applications and servers are doing if
they're running like even if they're
running into cloud or on premises
so how does this help you do your job
well
to know what our applications are doing
and how they are performing we need to
know certain things and this is what
application inside is very good at doing
it for example it knows about incoming
requests it can know about the
exceptions that your applications are
throwing
all depends it dependency calls they
make for example database calls outgoing
HTTP requests if you're talking to
third-party apis
it could be reddish queries you can put
your logs in there as well
and then you can get
sort of host metrics or server-side
metrics also from the runtime so you can
put in CPU counters
memory counters and if you're using.net
all sorts of runtime counters like
garbage collection statistics
but the way this all comes together
within application insights is it uses
tracing and correlation to group these
things together where they make sense so
when you're looking at individual
requests for example coming into your
website
you can see that that request made two
database calls one reddish query and
talk to some apis
now we're going to take a look at that a
little bit later
it's not just for.net or web apps that's
a thing I hear quite a lot that people
think it's just it's just for those it's
not there are officially supported
packages for a lot of program
languages.net node Java python
JavaScript more
and there are also third-party packages
for other languages available you can
use any desktop apps console apps
background app services that are running
doesn't really matter
and the documentation Microsoft has for
this is
very good at least to get people started
so just sort of to give you an idea
you're going to just do a short demo of
adding applications such to an existing
web application now I've already created
this application so
if you go ahead and and scan that QR
code and test it out
you can actually help us get some
metrics we'll use on later in the demo
so I'm just gonna while you do that I'm
gonna go to visual studio and we're
going to take a look at what we do
so
to start with of course we need a new
good package
I could just go ahead and do this can
everybody see this by the way
okay I could go ahead and do this but
that's not fun
um
so let's do this a manual way
so I will go and find
Microsoft application inside for asp.net
core there's an asp.net core application
install it
yes please
and
what happens is
we just got this package reference
that's pretty much all it needs
what we need to do as well
is we need to hook it up
so I've already created an application
inside resource in azure
so I'm just going to go ahead and copy
the connection string
put that in here as well
application
oops
in sight
okay
add
connection string
but do this correctly
um
like so
so that should be connection string
and then we need to set it up
go into our startup file if you're
familiar with asp.net core you should
probably recognize most of this
services
add application insights telemetry
and
we're pretty much done
at least for the server side but like I
mentioned before
application inside supports not just
node.js but JavaScript as well
so we can actually
it's not required this would be enough
for us to see what our server our
application is doing on the server side
but I am going to
add this to
my page as well so I can inject it
pretty similar to Google analytics so it
doesn't have like the same features yet
but we can get
Telemetry from their browsers as well
so I'm going to do this
location inside
core
JavaScript snippet
and I'm just going to put this into my
head tiger
go
raw because this is already
gives me the entire script that I need
full script
save this and we should be done and
let's see it build it's always better
succeeded
so if we run this
uh
site
someone's what we saw earlier
it's always bad when you click phishing
emails so let's see if
let's see if they have my password in
here super secret
yep
maybe that's not a very good password is
it
so if we go back to visual studio we're
gonna see this
we have already received seven instances
of telemetry from App insights just
running locally
and we can see what it's doing for
example we see our post I have to
refresh here
and if we scroll down it's just a short
overview this is the post that was made
when I clicked the button on my website
and you see this little thing here
there's a dependency in there
so this is application insights
automatically linking together the
external HTTP call that was made to the
pawn passwords API
to my request
and I can see that the dependency took
238 milliseconds
or happened at 238 milliseconds if we
look at it closely I can see the
duration for it
and let's fix this window a little bit
and we can even see that it was
what URL it connected to
what the status quo was and I can see
that it was an HTTP request
so this is just like a
this is basically how easy it is to get
started I had a reference
at the connection string register the
services doing startup and
in our case we added the
browser.javascript isn't really needed
but it's a good extra thing to have
so there are a lot of cool features we
get out of this once it's up and running
and if we take a look at those features
we can look at the amplification inside
stash boards like I said I already
created the resource it's been running
so if we want to look at one of my
favorite things to get out of this is
the application map
when application instance is running and
it monitors your application it can
actually start showing you what your
application is connected to
in our case
we have an instance here this is the
instance running in Azure currently
and we can see that it's connected to
the API at pawnpasswords.com and because
you guys scan the QR code and probably
try it out we've already made 68 calls
over there and the average response time
for it is 100 milliseconds
so this is a very quick bird's eye
overview that application in such gives
you of your application if I was
connecting to a database I would see
that popping up here as well
now we get this window as well this is
the
this is the client Telemetry we're
getting from your browsers
I can see that it is connecting
to localhost because that's what because
I was running it locally
and to the instance running
on that URL
now more things
live metrics this is also one of my
favorites
when you hook application insights up to
your service and starts running
you can get
this live metric overview
and I can see that the Azure server is
running and my laptop right here
so if I go back
because it's still running and I do
another one
I head back
I'm going to see requests coming in
and this is real-time data coming
from my browser
and the laptop as well
another thing that is really good out of
the box is you can start looking at
performance the performance of your
application and this is data that
application insights just gives me
straight out of the box with its asp.net
integration here's the endpoint that you
guys have been calling
and I can take a look at it and see a
distribution of the response times
and I can also start looking at the
dependencies
here are the calls that have been made
external apis
we can start looking at samples
now when I told you that it correlates
all these things we saw it in visual
studio if I click a sample in here
I've been says it's going to give me
request that was made
and the dependency is called and when it
happened like if it was making more
dependencies I would just see this see
more lines in here
and once your application if you set it
up in a way to expose for example custom
event you see these popping in there as
well and you get all this nice data on
the side seeing like what input was
being called
the path the duration
they even keep track of if it's a
successful call or not
so
and I think closely related to that is
failure investigation
now there's a bug in the website I'm
assuming some of you guys found it
already
if not I can show you what it is
so if I don't type anything
wait a minute nope that's the one
locally just go to the real one
is
if I don't type anything we get an error
because I'm not doing input validation
so
going back
we can see
that we are getting failures in our
application and it's automatically
seeing what kind of failures they are
if I just look at the last 30 minutes
we've gotten quite a few of them
now you know like I said it's
automatically picking up the exceptions
being thrown and showing to me right in
the dashboard so I can click this
set a string reference not to an
instance of a string which makes sense
and look at it
and similar to the performance Trace I
got I'm now seeing a trace full of
failure
so it's like all marked in red in return
to 500
through an exception at this point in
time
and I not only get that I get the stack
Trace
so I can immediately start seeing what's
wrong with my application without having
to press F5 myself and seeing what's
being thrown
I can see that this is happening like
right there in my code
so
that's
the failures
all right let's go out here
there's one other thing that happens we
have metrics as well
like I said app Inside by default
collects a lot of metrics for example
CPU statistics and more things
and we can even see I can start looking
at the browser page load time because I
added the script
I can look at client processing time
that's like how long your browser is
taking to like execute JavaScript on the
page like if I had a lot of it these
would be metrics that I would be wanna
keeping track of
so
out of the box it gives you it gives you
a lot of things that you don't really
you don't really have to do a lot of
work to get this
application Maps metrics failures
performance
and there are also all the things in
there which we'll get to later
but we can also add more metrics for
example in our case we're running on.net
and this website let's say it's
receiving a lot of traffic
and we might want to
add
some runtime metrics from.net
so I can go in here and I'm just going
to copy this in a bit because I'm just
going to go
gung-ho and add all the metrics in the
world
now
there's a lot I did want to type this
all out manually
.net built into.net are for example a
lot of counters that it keeps track of
in the.net runtime for example like the
time it's spending on garbage collection
the allocation rate how much CPU is
using
and if you have like a really highly
concurrent application
it keeps track of for example lock
attention counts Federal Q links how
many items have been run from the thread
pool so these are the kind of Statistics
you'd be looking at for a highly
concurrent application
but it also gives us for example hosting
metrics current number of requests
requests per second how many of them
failed in total
and getting all these metrics added in
there
is pretty easy
these are
it's not it's not exactly intuitive
to find out what these metrics are but
they are documented on Microsoft site so
that's pretty much where I picked all
these up
but adding them is simply a go to
configured Telemetry module in this case
there are a lot of modules within
application insights one of them is the
event counter collector
and I'm telling it what to collect now
when I run this
it's going to start the application just
like it did
and I'm just gonna
create some activity
oh that's a bad one
so if you go back
the metrics
are they are not pushed to application
insights like I said these are internal
counters so
application insights by default just
every 60 seconds it's going to get a
snapshot of those metrics and send them
up to the application inside ingestion
points
so as this timeline here approaches 60
seconds we've already just we've just
received seven items on Telemetry this
number is going to drop jump up pretty
dramatically we're at 11 now
and let's see when it hits 60 Seconds
and we should see a very Hefty jump here
exciting
there we go
jumped up and if we take a look at them
we can see
these are the metrics that I was
requesting when I set it up
for example current connections one it's
probably because it's just the one I'm
running locally
so it keeping track of all these
aggregation together and
sends them up to the application inside
service
so
adding them is
pretty easy to do it's also like if
you're if you have a dotnet application
that's perhaps big and complex you might
want to be exposing some of these like
your own metrics not just the ones from
the runtime
but that's another subject altogether
so you can gather all these helpful
statistics for example to help you out
with
an application that's receiving heavy
load so in that case you would be
looking at metrics that
help you do that for example garbage
collections
now
there's no use in gathering all this
data if you're not going to do anything
with it
otherwise it's just sitting there and
we're paying a lot of money for nothing
right
so
we need to create some sort of
monitoring
we need to create some sort of alerts or
dashboard because what use of a
dashboard if if no one's looking at it
right
so
let's see if we can combine these things
so if I go back here to my application
in such instance
one of the things that it has is
for example availability
so
availability tested basically
pinging your website and seeing if it's
returning values that it should be doing
for example
like if our website goes offline then
it's probably going to time out or if we
have an error it's going to start
returning 500s
so let's do a very simple test
just saying am I down
not sold down
we're gonna let it
ping our website
and we're gonna have to retrieve it
fails it can also do SSL certificate
validation so have any of you ever had
like an SSO certificate expire
you know in a live application and all
your users just say like they get a big
red screen in Chrome
this will help you prevent that
like ideally to automate this but if you
can't like this is a good thing to have
we're gonna test this every five minutes
from five locations now it automatically
picks geographically distributed
locations so in this case it's going to
do a request from South Central Us East
U.S East Asia
Central us and Australia I think that it
sort of picks these at random
but still tries to at least distribute
it
and it's going to do a standard get
request we can add custom headers if we
want to request
and here's the success criteria
we totally 120 second timeout let's put
that down to 30. it should return to
200.
but I want to make sure that my page is
returning what it should be returning so
I'm going to do a Content match
and if we go
back to our site
let's make sure that it's returning this
string
so I copy that
I'm going to say
should contain all command is your slow
2022
and create
so while this is creating
let me show you something else we can do
because this sometimes takes a few
minutes
I was showing you the metrics earlier
now we can take these metrics that we
have
and we can actually create a dashboard
pretty easily now these are all the
runtime metrics that we're getting but
let's get some of the standard ones
let's say we can want to get
exceptions
so this will give me the exceptions that
our application is
throwing
and if I want to put this up in a
dashboard
I can simply do
this
and just create a new one
and you see demo
and
we now have a dashboard
it's our exception counts
you can go back and add some more let's
take for example requests
can search here
Community quests
[Music]
server requests
save the dashboard
pin it
to this one
here it is now
this is one of those
strangely annoying Azure things I have
no idea why they just didn't put this at
the side they tend to put at the bottom
so let's fix that real quick
there and it's looking much better
now
dashboards can be shared we're not going
to go into that in detail but this is
how easy it is to at least create them
so
I'm going to go back and see we should
have our availability test running as
well
yep
here's the availability tests we created
and it's successful
you can even see the durations it took
to contact the website from all these
locations now it's going to be running
these availability tests every five
minutes
and it will let me know if any of them
fail but we'll get to that later as well
so we can combine these monitors and
alerts create dashboards all of them
create an alert when our site goes down
put some standard requests in browser
metrics
I forgot those show those later as well
those are pretty cool
but
it's all great but like these are just
standard things right we might have we
might have some custom thing that like
either custom events or metrics that we
want to put in there and we might want
to query those instead
so if that's not part of the standard
features in there what can we do about
that we like we might want to aggregate
things differently
so
in that case we need to be familiar with
Cousteau
Cousteau is the query language used in
Azure Monitor and application insights
pretty much everything Azure monitoring
application inside does ends up being
acoustic query somewhere
it's uh like I said it's a query
language it's similar to SQL in many
many regards the syntax not exactly the
same but it has pretty much all the same
features like filtering like where
statements
has what it calls projections that's
your your select statements and you can
do aggregations and
it's like it's really a rapid hole if
you start looking at the documentation
because they have so many cool functions
in there for example like if you let's
say you have a travel website
and like every spring people start
looking at travels they want to book
something
they even have like machine learning
functions in there that take
like that do predictions from
forecasting based on seasonality like
I've not used those a lot but those are
the kind of things that you can like
completely get lost into when you when
you start looking at this
so if you want to add some custom
Coastal queries to a dashboard we can do
that as well
so let's go back here
and what I'm going to do is
you know create like a custom exception
dashboard
so everything application inside does
ends up in what's called a log analytics
workspace that's sort of like the
data storage for Azure Monitor and
application insights
and
they have this thing called logs
and there we can actually create custom
queries
log management is pretty much the
database that application insights ends
up sending things into and here you can
see all the things that app in such is
gathering browser timings availability
results dependencies and events and we
can start querying these things
and even joining them together
but just to do this simply I'm gonna
paste this in here
we're going to fetch our app exceptions
but I'm doing like yeah I'm going to
explain this like it's basically the
table where you're selecting from
and every part of the query is separated
by a pipe
but in this case I'm filtering the
exceptions and I'm only taking
exceptions where the assembly is not
unknown now the reason is
net everything every exception.net
throws has an assembly or dll associated
with it
but because we added the browser
JavaScript browsers don't have
assemblies
so application insights automatically
gonna like put unknown into all
exceptions that come from the browser so
we're filtering those out I just want to
get the net exceptions
so I'm going to summarize those
exceptions and give me a count
for every five minutes
and I wanted to group it based on
exception type
so if we run this we will get data that
looks kind of like this
so at one point
we were getting nine exceptions
we were getting two one and we can put
this up in a chart if we want to and
it's already grouped
and once we start experimenting with
this we can actually go ahead and pin
this sort dashboard
there we go
yeah I don't want to save this query
now we have our exception statistics in
there grouped by exception type
so let's do one thing as well
we have this you can always go back and
edit the query if you want
in case you want to change the dashboard
So you you're not stuck with whatever
you did at that point
so
got acquainted with Cousteau see how it
works
the log query tools the log query tools
are also really nice they have like good
intelligence and tell you like show you
what functions you can use Etc
track that data and add that to our
dashboard
but the dashboard is only useful if it's
actually doing something
and
like I said what good is a dashboard if
no one's looking at it so let's have
Azure monitor to look at it
right
so we have our dashboard
there we go
right yep
it's called this
so what I can do here
is I can use any of the charts or
or any of the panels I have in my
dashboard as baselines for any alerts
that I might want to create
if I just take the exceptions one as an
example
I can open up the query again
and I can click this button new alert
rule
click this
and it's going to show us our query
and in this case we want to create an
alert out of this query
we're gonna it's automatically measuring
the count that's returned here
takes the total Aggregates it every five
minutes so I'm gonna say if we get
let's just say if we get an exception
within the last five minutes but I
wanted to evaluate it
every minute so that means that this
monitor every minute is going to run
that query
and if it sees an exception
in the last five minutes it's going to
trigger an alert
so here is example data that it shows
you for the last 30 minutes and this is
really good to use for example if you
if you have a metric that you want to
follow but it's like it's fluctuating
you can actually take this and look at
it for like I want to see like the last
three days I can't do it in this case
because I don't have that much have that
uh amount of data but then you can say
like look for anomaly and say okay if if
my value exceeds a certain threshold I'm
going to trigger the alert
so then we need an action
you can say I've already created an
action group which should send me an
email as well as send me a push
notification if I have the Azure app
installed on my phone
click that
these are the details I want this to be
a warning
oh no exceptions
there we go
and I wanted to just create it so this
is going to create the alert once
everything's ready
and that
like after I've created this now because
we have exceptions my phone should
probably notify me in a bit now
the alerts are not fully real time
because they're like there are ingestion
times involved
so we should get I should get a
notification here soonish
so we can take the query that we create
or that we already have on our dashboard
we can
look at what it's doing decide upon a
threshold that we want to use and then
start alerting based on those
you saw that we had like an alert group
in there so
alerts are organized
so you can create different groups and
different alerts can notify different
groups you can like notify more than one
group for example like if your site
stops with bonding send a notification
to the sres
if
you get like a number of exceptions
stating a certain threshold like send
that directly to the Developers
you can also look at things like if if
I'm not getting any traffic to my
payment page if I'm uh
if I'm selling something I want like we
stop receiving any payments notify the
CFO for example so these are the kind of
things you can do but alerts are not
just notifications I just use
notifications in this instance but it
also has triggers so it can have web
hooks
so you can hook those alerts up to slack
hook it up to teams
or things like pager Duty like you can
send emails text messages uh text
messages is not does not work for all
countries not voice calls either but
emails work and the push notifications
in the app
so you're you can pretty much do
whatever you want in there and
for example if you have a web hook
then you can send Json payload so you
can tell it like because for example
teams
expects a certain uh certain Json format
to come in and then you can get like you
can even in some instances you can
inject the dashboard chart itself into
the alert coming into a third
application
so
it's not perfect though
the monitors and dealers are cheap
they're not free but in this case the
alert I created cost like three bucks a
month I think and like I said it's not
quite real time
ingestion times for telemetry
can be from like 30 seconds up to a few
minutes
there we go notification on my phone oh
a few of them actually right cool it's
working
um
so there's another thing though like
I've just been showing you the Azure
portal and
the actual portal is quirky uh everyone
has used it probably knows what I'm
talking about
but since actually monitor has an API we
can hook this up to something like
grafana and grafana actually has very
good Azure monitor support
so there we can like get better
visualizations and dashboards and even
grafana has alerting options of his own
so you're like you're not stuck with
having to use the alerts that the Azure
portal must to give you
if you have if you already have
something like grafana and are already
using it for alerting you can do that
and not pay extra for the alerts in
azure
in in that case you'd only like you're
only paying for like the data ingested
into application insights as well as API
calls but the API calls aren't that
expensive
so if we take a look at how we would
query Azure monitor logs using grafana I
have
grafana instance running now
this is azure managed grafana I don't
know if many of you know this
they actually added
if we go over here create a resource
in case you don't have it
you can't do this I think it's I think
it's still in preview but you can create
a grafana instance and that actually
will automatically take care of adding
the Azure monitor data source and
hooking it up
if you just want to get started want to
experiment with this but if you already
have a grafana instance running
adding the Azure monitor data sources is
pretty easy as well
so what we get out of azure manage
grafana like I said is
it already creates a very basic
dashboard
we can look at
go to browse Azure monitor we can start
looking at our applications
and
we already get a pretty pretty good
looking dashboard
out of this
and this is just what comes out of the
box but then you can use this as a as a
Baseline and start customizing things
for example like here I'm seeing like
browser page load time breakdown I'm
seeing like how long it's taking to
process how much time the send requests
are taking in like how long the browser
has to wait for the page to respond and
I'm basically getting this for free this
is just this is just data that I added
by adding the JavaScript snippet and
everything else which was pretty much
like four lines of code
so 88 users tons of things but we might
want to do
something like creating our own
if I create a new dashboard add a new
panel
I can show you this real quick
pick a data source Azure monitor
and let's say I want to just start with
the metrics
I need to find my
my app service
here it is
I think it's this one
it's inside components and we can start
looking at things like
HTTP request rate
see
it doesn't want to load it
picked the wrong one I might have picked
the wrong one
let's look for recruit
um requests in here for example we can
start that look at this thing
there we go so these are for example
these are the outgoing requests that my
app my own application is making
so we can add this and give it a title
saying
outgoing requests
apply
got that going
but we're not just limited to using
metrics we can also use the crystal
queries
if I go in here and I pick logs instead
of metrics
search quicker that way we will get the
log analytics workspace
and we can do things like
this our application I added this
earlier like this demo but earlier today
I'm exposing metrics for the have open
phone calls
and I'm picking out
or exposing as an event within
application insights whenever I get a
hit or if I don't get a hit
so I'm taking the events looking for the
other pinpoint event which I created
and I have a property who says is it a
hit or not so I'm going to take with the
where we actually get ahead and I'm
gonna see how many times that password
is breached
so I should be able to put this up in a
graph as well if it loads here we go
it's not the prettiest graph because
password might be beats a thousand times
and then a million times so like the
scaling gets a lot of whack
but those are the kind of things that we
can
pretty easily do
the lines but if you want to customize
this have any of you used grafana before
it's pretty handy you can turn this into
a bar chart
a little bit like bigger
it's a little bit nicer to look at
so
it's easy to add
into third-party tools because we have
the apis
query metrics query logs simple to set
up dashboards
but
we can do more things
if we when we have time so I already
prepared this one because otherwise this
would probably take ages
we can have something like
and discard this
and we can start looking at for example
I create a basic one just takes a
requests response times
displays that sort of a health
I have a more advanced one
and these are the kind of cool things
that I love being able to do
so I can start seeing Advanced things
like aptx aptx is a metric that you can
create like I can say I expect my
website to respond in 50 milliseconds
so there are calculations that could be
made saying okay you are it kind of I
think it does like four times that time
then the user is frustrated but if it
exceeds uh four times
your expected response time is going to
say that the user is like yeah
frustrated or satisfied and it gives you
a score so I can say okay
in my case I'm expecting everything to
return in 50 milliseconds which is
really really low
it's all a post is not hitting that at
all because like the 50th percentile is
73 milliseconds
but also get these I get CPU search I'm
even getting a CPU usage from my laptop
because I hooked that up earlier and I
was running it
so it's kind of cool like seeing that
pop up in a cloud instance somewhere
get the response times I can group those
and an exception chart similar to what
we already had
but one of the awesome things that I've
seen that we can do is I can make this
clickable and actually get details on
just that endpoint
so I'm seeing like performance
statistics
all this data is just being pulled out
of azure monitor like this is this is
not something fancy you had to create
behind all of this if I look at it
it's just a custom query
although like there's a bit complicated
one but it's just acoustic query just
like anything else so I could even take
this query put that into the Azure
portal and get a very similar looking
dashboard in there
so I'm not I'm not limited to using just
whatever is either in the portal or in
some other application
and like I said
grafana has its own alerting
I could start creating
notifications
also grafana grafana I support for a lot
of things like Discord emails Google
Hangouts
pager Duty teams and everything else
so
that's also a thing that many people
think like they think that if they're
using application insights that they
need to use application insights you can
use applications and insights pretty
much just as a data store and use
whatever monitoring tool you have as
long as you're using the API the API in
the end is just
I think it's pretty much just Json
requests
so
if we if we recap this we can see that
like adding adding support for this is
It's relatively easy
not a lot of work at least not in the
case of an asp.net core application I
think node.js is similar like you had an
npm package and
at the server startup I think you had
like one line and maybe like put the
connection string in there
so
if you have any questions please like
bring them bring them in um
the
thing that I get asked about a lot is
like how expensive this is uh
it's not it's not that expensive of
course it depends on how much data
you're putting in there
and I think by default Azure or app
insights stores 90 days worth of data
and I you pay per gigabyte
so you can you can pretty much decide
how much you're paying because you can
do sampling for example if you have a
high throughput application like
immediately you'll be getting
tons of data in there but you can
configure applications as you do do
sampling for you even adaptive sampling
so like when you're getting a small
amount of requests it's basically giving
all the data for those but if if you
start hitting spikes it's just going to
take like every 10th request
and it does that automatically
so yeah if you have any questions right
bring them in it's kind of hard to see
because I might sit through my face
sorry
yeah
here on the metrics that we want
um
that's really not part of application
insights but Azure monitor has support
for yes you can put custom logs in there
so you can you can I think currently
they have they have an HTTP endpoint
so the question is uh just recap like
could you send Json logs in there for
example is that right
yeah
the event counters for example I think
you can yeah
um I'm pretty sure you can
yeah anyone else
I'll show you
so the question is I didn't put a
connection string when I was adding the
you're talking about the JavaScript
snippet I added yeah so I didn't put any
configuration there so how does it know
well
if we go back in here
still running
so we added
the snippet here JavaScript snippet and
what happens here is this is injecting
this is injecting
um
a class
that comes from the application inside
library and this class is automatically
picking up the configuration from my
startup because this server-side
rendered right
so when I
execute this full script
if I go to view source
right
that's not it
right
good view page source
what's this
right no it's a post goddammit okay
there we go
this is a script that gets injected
right
this is what happens you can see here's
my connection string
now where did it pick that up from is
this one because I added it when I added
the nougat package I had to add the
connection string into configuration
file to get this to posted data that's
how the JavaScript knows where to send
it
it must be used
you mean like sending Telemetry data
from the browser
yeah I I'm pretty sure we can like it
sends a lot of them by default like I
said sends the processing time and
everything else
you can
if you look at the documentation
just gonna go and find it
as you can never remember where it is
monitor you can
if you start looking at it
I think you have like JavaScript
client-side JavaScript in here you can
add the SDK like you you don't have to
use the snippet that it did you can't
just take the snippet and edit it
yourself if you if you have specific
configurations
so yeah let me repeat the question again
he was asking like if we can put like
besides default metrics that the
JavaScript snippet does can we add our
own
so yes you can do that because app
insights
loads up here this is for example the
node one at an npm package and add a few
lines and then the snippet you have
these things here
and I'm pretty sure that you can
configure a lot of things
and
you can also put in initialize it for
example if you want to add other
properties to Telemetry that's being
sent
you can configure that by saying like I
want you to add for example
like a message or I want you to add like
a property saying like
like which IPS issues are coming from
and there are a lot of properties in
there that you can configure both for
the connection string as well as any
custom metrics that you might be sending
pretty much
so you can hook you can hook into the
clients both both the asp.net one or
late.net one and the JavaScript one they
have injection points where you can
augment the Telemetry that is being sent
with like your own custom properties if
you want
that's right take one question
um I I'm not sure about the pricing
model is for grafana that's the price of
model in the Azure portal I think I'm
pretty sure alerts are just if you're
using
either grafana Enterprise or the cloud
version I think alerting is included but
someone might correct me on that if I'm
wrong
I think it's just part of the package
there so like I said like you're not
forced to use
the Azure ones you'll just be paying for
the API calls then instead but they're
like a lot cheaper
um
so
damn
before you at least before you leave I
can take a few more questions I think I
think we have time uh don't forget to
give feedback on your way out
if you have more questions even after
this talk just come feel free to ping me
I'll be around
or like you can you can contact me
either by my blog or Twitter so like
don't hesitate I have the QR codes there
QR codes are lovely
just all there's no talk like on Friday
I said yeah it's a good idea I'm gonna
add that
any more questions
yes right
uh yes is the answer
uh there was a story with open Telemetry
and application insights uh application
insights
they have like open Telemetry is like an
industry-wide thing where they were fine
they finally decided to like standardize
how these choices and everything is
collected
and open telemetry
has like packages for most programming
languages and one of those packages is I
think it's uh I think it's not part of
the official open Telemetry ones but I
think Azure has an open Telemetry sync
so you can take open to limit your data
within your application and send it to
app insights so for example like
I've seen people do like when they're
moving between providers you might be
going from App insights to Honeycomb or
vice versa if you're using open
Telemetry you could just basically add
both of those things and have them like
have them send the data to both places
at once without having to change a lot
of your code so like if you haven't
looked at open till M2 I definitely
recommend you do
right anyone else
right guess that's it then thank you
very much
enjoy the rest of the conference