SlideShare a Scribd company logo
1 of 48
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Debugging Modern Applications: Introduction to AWS X-Ray
Abhishek Singh,
Sr. Manager, Product Management
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What to expect from the session
 Overview
 Use Cases
 Concepts
 Getting Started
 Demo
 Q&A
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Debugging Applications
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Traditional Debugging
Developer Local Test
Developer
Add
Breakpoints
Add Log
Statements
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
The traditional process of debugging doesn’t scale well for production applications or
those built using a service-oriented, microservice, or serverless architecture
It’s tedious, repetitive, and time consuming.
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Monolithic
Monolithic vs. Service Oriented Architecture
Service Oriented Architecture
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Drawbacks of Monolithic Architecture
Hard to Iterate Fast CI/CD Time ConsumingHard to scale Efficiently
Reliability Challenges
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Benefits of Service Oriented Architecture
Increased Agility Easy to Scale Improved Innovation
Reduced Human Errors
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Monolithic vs. Service Oriented Applications
Move to service oriented (microservices) and serverless
architectures to overcome the drawbacks of a monolithic
application architecture
But microservices come with their own set of challenges
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Challenges
• Services such as AWS Lambda, Amazon EC2 Container Service, AWS
Elastic Beanstalk, AWS CloudFormation, etc. make it easier to deploy and
manage applications consisting of hundreds of services
Deploying and managing service oriented applications can be
more work compared to monolithic applications
Still hard to debug application issues in production applications due to:
 Cross-service interactions
 Varying log formats across services
 Collecting, aggregating, and collating logs from services
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Log Centric Approach
service 1 logs
service 2 logs
service 3 logs
user
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
User Centric Approach
user
Amazon API
Gateway
AWS Lambda
Amazon
DynamoDB
Amazon
SQS queue
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Identify Performance
Bottlenecks
How does AWS X-Ray help?
Pinpoint Specific
Service Issues
Identify Errors Identify Impact to Users
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Use Cases
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Visualize service call graph
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Identify impact
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Identify performance bottlenecks
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Identify performance bottlenecks
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Identify performance bottlenecks
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Identify performance bottlenecks
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Pinpoint issues
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Pinpoint issues
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Pinpoint issues
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
AWS Lambda
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
AWS Lambda
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Advanced Use Cases
Use off-cloud Custom Payload Deep Linking Custom Apps via
API
Filter Expressions
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
How does AWS X-Ray work?
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
X-Ray Service
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
X-Ray SDK
Enables you to get started quickly without having to manually instrument your
application code to log metadata about requests
Available for Java, .NET, and Node.js
Adds filters to automatically captures metadata for calls to:
 AWS services using the AWS SDK
 Non-AWS services over HTTP and HTTPS
 Databases (MySQL, PostgreSQL, and Amazon DynamoDB)
 Queues (Amazon SQS)
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
X-Ray Daemon
Receives data from the SDK over UDP and acts as a local buffer. Data
is flushed to the backend every second or when the local buffer fills.
Available for Amazon Linux AMI, RHEL, Ubuntu, OS X, and Windows.
Can be run anywhere as long as AWS credentials are provided (e.g.: EC2,
ECS, on premise, developer machine, etc.)
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
App & X-Ray
SDK
EC2 Instance
X-Ray
Daemon
Localhost
UDP
X-Ray API
HTTPS
HTTPS
X-Ray Console
App & X-Ray
SDK
Server
X-Ray
Daemon
Localhost
UDP
EC2 Role
AWS
Credentials
DevOps Team
HTTPS
X-Ray Workflow
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Concepts
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
X-Ray Concepts
Trace End-to-end data related a single request across services
Segments Portions of the trace that correspond to a single service
Sub-segments Remote call or local compute sections within a service
Annotations Business data that can be used to filter traces
Metadata Business data that can be added to the trace but not used for filtering traces
Errors Normalized error message and stack trace
Sampling Percentage of requests to your application to capture as traces
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
X-Ray Concepts
user
Amazon API
Gateway
AWS Lambda
Amazon
DynamoDB
Amazon
SQS queue
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Sampling Configuration
{
"rules": {
“payment": {
"id": 1,
"service_name": "*",
"http_method": "*",
"url_path": "/api/payment/*",
"fixed_target": 0,
"rate": 1.00
},
"base": {
"id": 2,
"service_name": "*",
"http_method": "*",
"url_path": "*",
"fixed_target": 1,
"rate": 0.1
}
}
}
This example defines two rules.
The first rule applies a 100 percent sampling rate
with no minimum number of requests to trace to
requests with paths under /api/payment
The second overrides the default sampling rule
with a rule that traces the first request each
second and 10 percent of additional requests.
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
APIs
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
X-Ray API
X-Ray provides a set of APIs to enable you to send, filter, and retrieve
trace data
You can send trace data directly to the service without having to use
our SDKs (i.e.: you can write your own SDKs for languages not
currently supported)
Raw trace data is available using batch get APIs
You can build your own data analysis applications on top of the data
collected by X-Ray
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
X-Ray API
PutTraceSegments Uploads segment documents to AWS X-Ray
BatchGetTraces Retrieves a list of traces specified by ID
GetServiceGraph Retrieves a document that describes services in your application and their
connections
GetTraceSummaries Retrieves IDs and metadata for traces available for a specified time frame
using an optional filter
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Segment Document
Minimal example
{
"name" : "example.com",
"id" : "70de5b6f19ff9a0a",
"start_time" : 1.478293361271E9,
"trace_id" : "1-581cf771-a006649127e371903a2de979",
"end_time" : 1.478293361449E9
}
Example showing an in-progress segment
{
"name" : "example.com",
"id" : "70de5b6f19ff9a0b",
"start_time" : 1.478293361271E9,
"trace_id" : "1-581cf771-a006649127e371903a2de979",
“in_progress”: true
}
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Getting Started
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Agent installation (Amazon EC2 Linux)
#!/bin/bash
curl https://s3.dualstack.us-east-1.amazonaws.com/aws-xray-assets.us-east-1/xray-daemon/aws-xray-
daemon-1.x.rpm -o /home/ec2-user/xray.rpm
yum install -y /home/ec2-user/xray.rpm
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Agent Installation (Amazon EC2 Windows)
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Agent installation (Amazon ECS)
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
App Instrumentation (Node.js)
//Add aws-xray-sdk package to package.json
var XRay = require('aws-xray-sdk');
var AWS = captureAWS(require('aws-sdk'));
…
XRay.config([XRay.plugins.EC2]);
XRay.captureHTTPs(http);
XRay.setDefaultName('myfrontend-dev');
…
app.use(XRay.express.openSegment());
app.get('/', function(req, res)
…
app.get('/blog', function(req, res)
…
app.use(XRay.express.closeSegment());
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Demo
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
X-Ray Pricing
Free tier
 The first 100,000 traces recorded are free
 The first 1,000,000 traces retrieved or scanned are free
Additional charges
 Beyond the free tier, traces recorded cost $5.00 per million traces.
 Beyond the free tier, traces retrieved or scanned cost $0.50 per million traces.
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Availability
 Go to https://aws.amazon.com/xray to learn more
 Documentation: http://docs.aws.amazon.com/xray/latest/devguide/aws-xray.html
 .NET Sample: https://github.com/awslabs/aws-xray-dotnet-webapp
 Java Sample: https://github.com/awslabs/eb-java-scorekeep/tree/xray
 Node.js Sample: https://github.com/awslabs/eb-node-express-sample/tree/xray
The AWS X-Ray service is available in 14 regions today.
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
aws.amazon.com/activate
Everything and Anything Startups
Need to Get Started on AWS

More Related Content

What's hot

Protect your applications from DDoS/BOT & Advanced Attacks
Protect your applications from DDoS/BOT & Advanced AttacksProtect your applications from DDoS/BOT & Advanced Attacks
Protect your applications from DDoS/BOT & Advanced Attacks
Amazon Web Services
 
Best Practices to Mitigate from the Emerging Vectors of Network Attack
Best Practices to Mitigate from the Emerging Vectors of Network AttackBest Practices to Mitigate from the Emerging Vectors of Network Attack
Best Practices to Mitigate from the Emerging Vectors of Network Attack
Amazon Web Services
 

What's hot (20)

State of the Union : Security
State of the Union : SecurityState of the Union : Security
State of the Union : Security
 
Introduction and Overview of Mobile App and Web App Development with AWS
Introduction and Overview of Mobile App and Web App Development with AWSIntroduction and Overview of Mobile App and Web App Development with AWS
Introduction and Overview of Mobile App and Web App Development with AWS
 
Protect your applications from DDoS/BOT & Advanced Attacks
Protect your applications from DDoS/BOT & Advanced AttacksProtect your applications from DDoS/BOT & Advanced Attacks
Protect your applications from DDoS/BOT & Advanced Attacks
 
Introduction to AWS for Android Developers
Introduction to AWS for Android DevelopersIntroduction to AWS for Android Developers
Introduction to AWS for Android Developers
 
Module 3: Security, Identity and Access Management - AWSome Day Online Confer...
Module 3: Security, Identity and Access Management - AWSome Day Online Confer...Module 3: Security, Identity and Access Management - AWSome Day Online Confer...
Module 3: Security, Identity and Access Management - AWSome Day Online Confer...
 
Serverless Geospatial Mobile Apps with AWS
Serverless Geospatial Mobile Apps with AWSServerless Geospatial Mobile Apps with AWS
Serverless Geospatial Mobile Apps with AWS
 
User Authentication and Identity with Amazon Cognito
User Authentication and Identity with Amazon CognitoUser Authentication and Identity with Amazon Cognito
User Authentication and Identity with Amazon Cognito
 
Mobile Web and App Development with AWS
Mobile Web and App Development with AWSMobile Web and App Development with AWS
Mobile Web and App Development with AWS
 
DevOps en Amazon: Un vistazo a nuestras herramientas y procesos
DevOps en Amazon: Un vistazo a nuestras herramientas y procesosDevOps en Amazon: Un vistazo a nuestras herramientas y procesos
DevOps en Amazon: Un vistazo a nuestras herramientas y procesos
 
Opening Keynote - AWS Summit SG 2017
Opening Keynote - AWS Summit SG 2017Opening Keynote - AWS Summit SG 2017
Opening Keynote - AWS Summit SG 2017
 
Primeros pasos con arquitecturas serverless
Primeros pasos con arquitecturas serverlessPrimeros pasos con arquitecturas serverless
Primeros pasos con arquitecturas serverless
 
AWS business essentials
AWS business essentials AWS business essentials
AWS business essentials
 
What’s New with AWS Mobile Services
What’s New with AWS Mobile ServicesWhat’s New with AWS Mobile Services
What’s New with AWS Mobile Services
 
Best Practices to Mitigate from the Emerging Vectors of Network Attack
Best Practices to Mitigate from the Emerging Vectors of Network AttackBest Practices to Mitigate from the Emerging Vectors of Network Attack
Best Practices to Mitigate from the Emerging Vectors of Network Attack
 
NEW LAUNCH! Enhance Your Mobile Apps with AI Using Amazon Lex
NEW LAUNCH! Enhance Your Mobile Apps with AI Using Amazon LexNEW LAUNCH! Enhance Your Mobile Apps with AI Using Amazon Lex
NEW LAUNCH! Enhance Your Mobile Apps with AI Using Amazon Lex
 
Developing Connected Applications with Amazon Web Services IoT
Developing Connected Applications with Amazon Web Services IoTDeveloping Connected Applications with Amazon Web Services IoT
Developing Connected Applications with Amazon Web Services IoT
 
Identity Management for Your Users and Apps: A Deep Dive on Amazon Cognito - ...
Identity Management for Your Users and Apps: A Deep Dive on Amazon Cognito - ...Identity Management for Your Users and Apps: A Deep Dive on Amazon Cognito - ...
Identity Management for Your Users and Apps: A Deep Dive on Amazon Cognito - ...
 
Using Amazon Inspector to Discover Potential Security Issues - AWS Online Tec...
Using Amazon Inspector to Discover Potential Security Issues - AWS Online Tec...Using Amazon Inspector to Discover Potential Security Issues - AWS Online Tec...
Using Amazon Inspector to Discover Potential Security Issues - AWS Online Tec...
 
IT empresarial en la nube
IT empresarial en la nubeIT empresarial en la nube
IT empresarial en la nube
 
I servizi AWS per le applicazioni mobili: sviluppo, test e produzione
I servizi AWS per le applicazioni mobili: sviluppo, test e produzioneI servizi AWS per le applicazioni mobili: sviluppo, test e produzione
I servizi AWS per le applicazioni mobili: sviluppo, test e produzione
 

Similar to Debugging Modern Applications: Introduction to AWS X-Ray

데이터 센터 모던화::임흥선::AWS Summit Seoul 2018
데이터 센터 모던화::임흥선::AWS Summit Seoul 2018데이터 센터 모던화::임흥선::AWS Summit Seoul 2018
데이터 센터 모던화::임흥선::AWS Summit Seoul 2018
Amazon Web Services Korea
 

Similar to Debugging Modern Applications: Introduction to AWS X-Ray (20)

Getting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingGetting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless Computing
 
AWS X-Ray: Debugging Applications at Scale - AWS Online Tech Talks
AWS X-Ray: Debugging Applications at Scale - AWS Online Tech TalksAWS X-Ray: Debugging Applications at Scale - AWS Online Tech Talks
AWS X-Ray: Debugging Applications at Scale - AWS Online Tech Talks
 
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer ToolsA Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
 
Deep-Dive: Developing Mobile Web Applications with AWS
Deep-Dive: Developing Mobile Web Applications with AWSDeep-Dive: Developing Mobile Web Applications with AWS
Deep-Dive: Developing Mobile Web Applications with AWS
 
Debug your Container and Serverless Applications with AWS X-Ray in 5 Minutes ...
Debug your Container and Serverless Applications with AWS X-Ray in 5 Minutes ...Debug your Container and Serverless Applications with AWS X-Ray in 5 Minutes ...
Debug your Container and Serverless Applications with AWS X-Ray in 5 Minutes ...
 
DEV204_Debugging Modern Applications Introduction to AWS X-Ray
DEV204_Debugging Modern Applications Introduction to AWS X-RayDEV204_Debugging Modern Applications Introduction to AWS X-Ray
DEV204_Debugging Modern Applications Introduction to AWS X-Ray
 
Wild rydes serverless website workshop
Wild rydes   serverless website workshopWild rydes   serverless website workshop
Wild rydes serverless website workshop
 
Introduction to AWS Mobile: Building Scalable and Secure Mobile Apps with AWS
Introduction to AWS Mobile: Building Scalable and Secure Mobile Apps with AWSIntroduction to AWS Mobile: Building Scalable and Secure Mobile Apps with AWS
Introduction to AWS Mobile: Building Scalable and Secure Mobile Apps with AWS
 
Instrumenting Kubernetes for Observability Using AWS X-Ray and Amazon CloudWa...
Instrumenting Kubernetes for Observability Using AWS X-Ray and Amazon CloudWa...Instrumenting Kubernetes for Observability Using AWS X-Ray and Amazon CloudWa...
Instrumenting Kubernetes for Observability Using AWS X-Ray and Amazon CloudWa...
 
데이터 센터 모던화::임흥선::AWS Summit Seoul 2018
데이터 센터 모던화::임흥선::AWS Summit Seoul 2018데이터 센터 모던화::임흥선::AWS Summit Seoul 2018
데이터 센터 모던화::임흥선::AWS Summit Seoul 2018
 
[NEW LAUNCH!] Introducing AWS App Mesh – service mesh on AWS (CON367) - AWS r...
[NEW LAUNCH!] Introducing AWS App Mesh – service mesh on AWS (CON367) - AWS r...[NEW LAUNCH!] Introducing AWS App Mesh – service mesh on AWS (CON367) - AWS r...
[NEW LAUNCH!] Introducing AWS App Mesh – service mesh on AWS (CON367) - AWS r...
 
What's New in Serverless - SRV305 - re:Invent 2017
What's New in Serverless - SRV305 - re:Invent 2017What's New in Serverless - SRV305 - re:Invent 2017
What's New in Serverless - SRV305 - re:Invent 2017
 
Workshop: DevOps and Highly-Available Systems
Workshop: DevOps and Highly-Available SystemsWorkshop: DevOps and Highly-Available Systems
Workshop: DevOps and Highly-Available Systems
 
NET203_Using Amazon VPC Flow Logs to Do Predictive Security Analytics
NET203_Using Amazon VPC Flow Logs to Do Predictive Security AnalyticsNET203_Using Amazon VPC Flow Logs to Do Predictive Security Analytics
NET203_Using Amazon VPC Flow Logs to Do Predictive Security Analytics
 
NET203_Using Amazon VPC Flow Logs to Do Predictive Security Analytics
NET203_Using Amazon VPC Flow Logs to Do Predictive Security AnalyticsNET203_Using Amazon VPC Flow Logs to Do Predictive Security Analytics
NET203_Using Amazon VPC Flow Logs to Do Predictive Security Analytics
 
Keys to Successfully Monitoring and Optimizing Innovative and Sophisticated C...
Keys to Successfully Monitoring and Optimizing Innovative and Sophisticated C...Keys to Successfully Monitoring and Optimizing Innovative and Sophisticated C...
Keys to Successfully Monitoring and Optimizing Innovative and Sophisticated C...
 
Microservices for Startups
Microservices for StartupsMicroservices for Startups
Microservices for Startups
 
Build and Test a Serverless Error-Tracking Tool in One Weekend (SRV346-R1) - ...
Build and Test a Serverless Error-Tracking Tool in One Weekend (SRV346-R1) - ...Build and Test a Serverless Error-Tracking Tool in One Weekend (SRV346-R1) - ...
Build and Test a Serverless Error-Tracking Tool in One Weekend (SRV346-R1) - ...
 
DevConZM - Modern Applications Development in the Cloud
DevConZM - Modern Applications Development in the CloudDevConZM - Modern Applications Development in the Cloud
DevConZM - Modern Applications Development in the Cloud
 
Introduction to Developing for Mobile with AWS
Introduction to Developing for Mobile with AWSIntroduction to Developing for Mobile with AWS
Introduction to Developing for Mobile with AWS
 

More from Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Debugging Modern Applications: Introduction to AWS X-Ray

  • 1. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Debugging Modern Applications: Introduction to AWS X-Ray Abhishek Singh, Sr. Manager, Product Management
  • 2. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved What to expect from the session  Overview  Use Cases  Concepts  Getting Started  Demo  Q&A
  • 3. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Debugging Applications
  • 4. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Traditional Debugging Developer Local Test Developer Add Breakpoints Add Log Statements
  • 5. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved The traditional process of debugging doesn’t scale well for production applications or those built using a service-oriented, microservice, or serverless architecture It’s tedious, repetitive, and time consuming.
  • 6. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Monolithic Monolithic vs. Service Oriented Architecture Service Oriented Architecture
  • 7. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Drawbacks of Monolithic Architecture Hard to Iterate Fast CI/CD Time ConsumingHard to scale Efficiently Reliability Challenges
  • 8. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Benefits of Service Oriented Architecture Increased Agility Easy to Scale Improved Innovation Reduced Human Errors
  • 9. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Monolithic vs. Service Oriented Applications Move to service oriented (microservices) and serverless architectures to overcome the drawbacks of a monolithic application architecture But microservices come with their own set of challenges
  • 10. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Challenges • Services such as AWS Lambda, Amazon EC2 Container Service, AWS Elastic Beanstalk, AWS CloudFormation, etc. make it easier to deploy and manage applications consisting of hundreds of services Deploying and managing service oriented applications can be more work compared to monolithic applications Still hard to debug application issues in production applications due to:  Cross-service interactions  Varying log formats across services  Collecting, aggregating, and collating logs from services
  • 11. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Log Centric Approach service 1 logs service 2 logs service 3 logs user
  • 12. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved User Centric Approach user Amazon API Gateway AWS Lambda Amazon DynamoDB Amazon SQS queue
  • 13. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Identify Performance Bottlenecks How does AWS X-Ray help? Pinpoint Specific Service Issues Identify Errors Identify Impact to Users
  • 14. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Use Cases
  • 15. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Visualize service call graph
  • 16. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Identify impact
  • 17. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Identify performance bottlenecks
  • 18. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Identify performance bottlenecks
  • 19. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Identify performance bottlenecks
  • 20. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Identify performance bottlenecks
  • 21. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Pinpoint issues
  • 22. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Pinpoint issues
  • 23. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Pinpoint issues
  • 24. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved AWS Lambda
  • 25. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved AWS Lambda
  • 26. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Advanced Use Cases Use off-cloud Custom Payload Deep Linking Custom Apps via API Filter Expressions
  • 27. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved How does AWS X-Ray work?
  • 28. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved X-Ray Service
  • 29. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved X-Ray SDK Enables you to get started quickly without having to manually instrument your application code to log metadata about requests Available for Java, .NET, and Node.js Adds filters to automatically captures metadata for calls to:  AWS services using the AWS SDK  Non-AWS services over HTTP and HTTPS  Databases (MySQL, PostgreSQL, and Amazon DynamoDB)  Queues (Amazon SQS)
  • 30. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved X-Ray Daemon Receives data from the SDK over UDP and acts as a local buffer. Data is flushed to the backend every second or when the local buffer fills. Available for Amazon Linux AMI, RHEL, Ubuntu, OS X, and Windows. Can be run anywhere as long as AWS credentials are provided (e.g.: EC2, ECS, on premise, developer machine, etc.)
  • 31. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved App & X-Ray SDK EC2 Instance X-Ray Daemon Localhost UDP X-Ray API HTTPS HTTPS X-Ray Console App & X-Ray SDK Server X-Ray Daemon Localhost UDP EC2 Role AWS Credentials DevOps Team HTTPS X-Ray Workflow
  • 32. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Concepts
  • 33. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved X-Ray Concepts Trace End-to-end data related a single request across services Segments Portions of the trace that correspond to a single service Sub-segments Remote call or local compute sections within a service Annotations Business data that can be used to filter traces Metadata Business data that can be added to the trace but not used for filtering traces Errors Normalized error message and stack trace Sampling Percentage of requests to your application to capture as traces
  • 34. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved X-Ray Concepts user Amazon API Gateway AWS Lambda Amazon DynamoDB Amazon SQS queue
  • 35. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Sampling Configuration { "rules": { “payment": { "id": 1, "service_name": "*", "http_method": "*", "url_path": "/api/payment/*", "fixed_target": 0, "rate": 1.00 }, "base": { "id": 2, "service_name": "*", "http_method": "*", "url_path": "*", "fixed_target": 1, "rate": 0.1 } } } This example defines two rules. The first rule applies a 100 percent sampling rate with no minimum number of requests to trace to requests with paths under /api/payment The second overrides the default sampling rule with a rule that traces the first request each second and 10 percent of additional requests.
  • 36. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved APIs
  • 37. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved X-Ray API X-Ray provides a set of APIs to enable you to send, filter, and retrieve trace data You can send trace data directly to the service without having to use our SDKs (i.e.: you can write your own SDKs for languages not currently supported) Raw trace data is available using batch get APIs You can build your own data analysis applications on top of the data collected by X-Ray
  • 38. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved X-Ray API PutTraceSegments Uploads segment documents to AWS X-Ray BatchGetTraces Retrieves a list of traces specified by ID GetServiceGraph Retrieves a document that describes services in your application and their connections GetTraceSummaries Retrieves IDs and metadata for traces available for a specified time frame using an optional filter
  • 39. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Segment Document Minimal example { "name" : "example.com", "id" : "70de5b6f19ff9a0a", "start_time" : 1.478293361271E9, "trace_id" : "1-581cf771-a006649127e371903a2de979", "end_time" : 1.478293361449E9 } Example showing an in-progress segment { "name" : "example.com", "id" : "70de5b6f19ff9a0b", "start_time" : 1.478293361271E9, "trace_id" : "1-581cf771-a006649127e371903a2de979", “in_progress”: true }
  • 40. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Getting Started
  • 41. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Agent installation (Amazon EC2 Linux) #!/bin/bash curl https://s3.dualstack.us-east-1.amazonaws.com/aws-xray-assets.us-east-1/xray-daemon/aws-xray- daemon-1.x.rpm -o /home/ec2-user/xray.rpm yum install -y /home/ec2-user/xray.rpm
  • 42. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Agent Installation (Amazon EC2 Windows)
  • 43. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Agent installation (Amazon ECS)
  • 44. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved App Instrumentation (Node.js) //Add aws-xray-sdk package to package.json var XRay = require('aws-xray-sdk'); var AWS = captureAWS(require('aws-sdk')); … XRay.config([XRay.plugins.EC2]); XRay.captureHTTPs(http); XRay.setDefaultName('myfrontend-dev'); … app.use(XRay.express.openSegment()); app.get('/', function(req, res) … app.get('/blog', function(req, res) … app.use(XRay.express.closeSegment());
  • 45. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Demo
  • 46. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved X-Ray Pricing Free tier  The first 100,000 traces recorded are free  The first 1,000,000 traces retrieved or scanned are free Additional charges  Beyond the free tier, traces recorded cost $5.00 per million traces.  Beyond the free tier, traces retrieved or scanned cost $0.50 per million traces.
  • 47. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Availability  Go to https://aws.amazon.com/xray to learn more  Documentation: http://docs.aws.amazon.com/xray/latest/devguide/aws-xray.html  .NET Sample: https://github.com/awslabs/aws-xray-dotnet-webapp  Java Sample: https://github.com/awslabs/eb-java-scorekeep/tree/xray  Node.js Sample: https://github.com/awslabs/eb-node-express-sample/tree/xray The AWS X-Ray service is available in 14 regions today.
  • 48. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved aws.amazon.com/activate Everything and Anything Startups Need to Get Started on AWS