[Music]
hello my name is Boris Nissenbaum I'm a
solution architect on the global
solution architecture team specializing
in Microsoft technologies on Amazon Web
Services the topic of today's
presentation is monitoring and
diagnostic of dotnet applications with
AWS x-ray I would like to point out that
this presentation is not a deep dive
into all the features and capabilities
of the AWS x-ray for an extensive
investigation of AWS x-ray features and
capabilities I suggest watching the
correspondent sessions from rain van
2017 the links to which I will provide
at the end of the presentation today's
session will include a brief general
overview of AWS x-ray SDK we will go
over location and installation of SDK
NuGet packages key points for enabling
the application to take advantage of AWS
x-ray service and review the specific
steps needed to monitor dotnet
application requests and point to the
location of extensive information on the
x-ray service I will show you how easy
it is to enable your custom asp.net
application for x-rays monitoring we
will walk for a sample dotnet
application and identify the basic steps
that are required to enable it to
January traces in the AWS x-ray service
as you're probably aware x-ray allows
developers to analyze distributed
applications and helps troubleshoot
issues with application its underlying
services and performance AWS x-ray
supports a number of development
frameworks such as java.net dotnet core
2.0 Python and node.js it has an ability
to generate traces for AWS services as
well as for the request to non AWS
services over HTTP and HTTPS it can also
monitor requests to various AWS database
services such as dynamic DB and RDS AWS
x-ray SDK for dotnet has been around for
a while
however in new version 2
zero has been introduced in the recent
weeks this version is available as a
beta and has been released to the github
version 2.0 not only supports a legacy
dotnet frameworks but also enables
support for dotnet core 2.0 as well as a
SS Lambda support so let's take a look
at sample asp.net application okay so
here we have a sample asp.net
application which I opened in Visual
Studio 2017 let's examine what NuGet
packages are installed here so if I go
to manage NuGet packages you can see
that I have AWS SDK that core and AWS
SDK DynamoDB NuGet package is installed
it simply stores the data in dynamo DB
and queries AWS rjs service for data the
products controller module defines a few
functions which are used by this
application as you can see the query
product function make HTTP requests and
query cycle are the free functions
defined here if we publish this
application to AWS elastic Beanstalk it
will look like this if I retrieve the
product from the database you can see
that the application responds with the
product displayed on the screen we can
do a few more queries to make sure that
the data is there so now let's go to AWS
console and take a look at the x-ray
traces so as you can see we currently do
not have any service map or traces
generated by this application now let's
take a look at the same application
which has been instrumented for AWS
x-ray first of all we have additional
NuGet packages installed here which are
specifically related to AWS x-ray and
AWS x-ray SDK so those are AWS x-ray
recorded at core AWS extra core handlers
asp.net and SDK there are few AWS x-ray
related packages part of this SDK
you can find them if you browse it and
make a filter on x-ray as you can see
this is the list of they're all
available AWS x-ray SDK you'll get
packages it's important to remember that
since this SDK is currently in beta you
have to check the box include
pre-release to make sure that you can
see those packages the next step will be
to register x-ray for the object of
system that web that HTTP application
class in the init method of global sx
file in global sx file you can see that
I have a SS x-ray register with the
default application name is p.net test
keep in mind that this name is the name
which will show up in AWS x-ray console
you can use any name you want to
uniquely identify your application the
next thing we need to do is to configure
the web config file over here we're
registering the AWS x-ray plugging in
this case it's going to be easier to
plug in because the application will
work on elastic Beanstalk so it will
utilize this easy to plug in interesting
point here is that if disabled x-rays
training key is set to false the x-rays
pressing in enable if you want to
temporarily stop X ray tracing you can
set this value to true now let's take a
look at products controller you can see
that the functions which were shown
originally have been slightly modified
with the numeric methods from AWS SDK in
particular we now say have AWS x-ray
recorder instance traced method which
allows us to trace the request to the
DynamoDB database as well as outgoing
HTTP requests and sickle queries for
outgoing HTTP requests we are utilizing
the get response traced method to query
the sequel server we are using a wrapper
class which is called traceable see
command this traceable cycle command can
be utilized interchangeably with sickle
command and allows you to trace the
request to any sickle server database
after the application is published to
elastic beanstalk it looks exactly like
the non instrumented application which
has shown you before if we make a few
queries for the products inside the
database we will generate a few traces
which I'll show you in an xray console
in a second if we open up the AWS x-ray
console we can see that our application
currently has generated a few traces if
we take a look at the traces you can see
that we are monitoring the request to
the HTTP as well as sequel server for
good go to the trace details you can see
the request which were generated by my
application so there isn't
304 millisecond time which was required
to issue the asp.net test which includes
a query product DynamoDB and outgoing
HTTP request separately we have a sub
trace to query SQL which took one
millisecond we can take a look at the
raw data which is presented in the JSON
format as well as a timeline with all
the dependencies we can drill down to
individual requests for additional
information as you can see we
successfully instrumented the
application for AWS x-ray and we can see
the traces in AWS x-ray console and
finally as promised where we can find
more information I would suggest
referring to reinvent 2017 sessions
which I put on the screen the
documentation for AWS x-ray can be found
at this link it's also very important
that you know about the location of the
x-ray that net SDK on github as well as
the developer blog which covers all the
most important functionality of AWS
x-ray
that concludes our today's presentation
about AWS x-ray SDK thank you for
watching
[Music]