SlideShare ist ein Scribd-Unternehmen logo
1 von 42
Introduction to AWS X-Ray
Overview and Use Cases
Randall Hunt
Technical Evangelist, AWS
@jrhunt
Agenda
• Overview
• Concepts
• API
• Use cases
• Getting started
• Demo
• Q & A
Debugging applications
Development vs. production
Traditional debugging involves:
• A development environment
• Search through logs for clues to reproduce the issue
• Set breakpoints in code to stop execution, and inspect variables and call stack
• Add additional log statements as necessary and redeploy application
• Repeat until the issue is fixed
Traditional process of debugging doesn’t scale well to production
applications or those built using a service-oriented, microservice, or
serverless architecture
It’s tedious, repetitive, and time consuming
Monolithic vs. service-oriented applications
Applications traditionally developed using a monolithic architecture
Move to service oriented (microservices) architecture to overcome the
drawbacks of a monolithic application architecture
But microservices come with their own set of challenges
Benefits:
• Simple to develop
• Simple to test and debug
• Simple to deploy
• Simple to scale
Drawbacks:
• Hard to iterate fast
• Hard to scale efficiently
• CI/CD time consuming and difficult
• Reliability challenges — a problem
with a single component can take
down the whole app
Challenges
Deploying and managing service-oriented applications is more work
compared to monolithic applications
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
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
Solution
AWS X-Ray makes it easy to:
• Identify performance bottlenecks and errors
• Pinpoint issues to specific service(s) in your application
• Identify impact of issues on users of the application
• Visualize the service call graph of your application
How does X-Ray help?
X-Ray service
X-Ray SDK
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)
Enables you to get started quickly without having to manually instrument
your application code to log metadata about requests
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
Concepts
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 configuration
• {
• "rules": {
• "move": {
• "id": 1,
• "service_name": "*",
• "http_method": "*",
• "url_path": "/api/move/*",
• "fixed_target": 0,
• "rate": 0.05
• },
• "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 five-percent sampling rate
with no minimum number of requests to trace to
requests with paths under /api/move
The second overrides the default sampling rule
with a rule that traces the first request each
second and 10 percent of additional requests.
APIs
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
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
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
• }
Traced Request
X-Amzn-Trace-Id: Root=1-5759e988-bd862e3fe1be46a994272793;Sampled=1
Version number
Hex of epoch timestamp
Optional: Parent segment ID
96 bit globally unique id for
trace (24 hex digits)
Use cases
Visualize service call graph
Identify impact
Identify impact
Identify performance bottlenecks
Identify performance bottlenecks
Identify performance bottlenecks
Identify performance bottlenecks
Pinpoint issues
Pinpoint issues
Pinpoint issues
Getting started
Agent installation (Amazon EC2 Linux)
Agent Installation (Amazon EC2 Windows)
Agent installation (Amazon ECS)
Application 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.use(XRay.express.closeSegment());
Demo
Pricing
X-Ray pricing
Free during the preview. After that:
Free tier
• The first 100,000 traces recorded per month are free
• The first 1,000,000 traces retrieved or scanned per month are free
Additional charges
• Beyond the free tier, traces recorded cost $5.00 per million per month
• Beyond the free tier, traces retrieved or scanned cost $0.50 per million per
month
Currently AWS Supported SDKs and Frameworks
• Java
• Tomcat, Spring Boot, Servlet filters
• Node.js (express filters)
• C# (.NET, .NET core)
Currently (Natively) Supported Services
• ELB
• Lambda
• API Gateway
• EC2
• Elastic Beanstalk
Available today!
• The AWS X-Ray service is available in preview today.
• Go to https://aws.amazon.com/xray to sign up for the preview.
• 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
Thank You.

Weitere ähnliche Inhalte

Was ist angesagt?

Building CI-CD Pipelines for Serverless Applications
Building CI-CD Pipelines for Serverless ApplicationsBuilding CI-CD Pipelines for Serverless Applications
Building CI-CD Pipelines for Serverless ApplicationsAmazon Web Services
 
SMC303 Real-time Data Processing Using AWS Lambda
SMC303 Real-time Data Processing Using AWS LambdaSMC303 Real-time Data Processing Using AWS Lambda
SMC303 Real-time Data Processing Using AWS LambdaAmazon Web Services
 
DevOps on AWS: Advanced Techniques for Amazon EC2 Deployments on AWS
DevOps on AWS: Advanced Techniques for Amazon EC2 Deployments on AWSDevOps on AWS: Advanced Techniques for Amazon EC2 Deployments on AWS
DevOps on AWS: Advanced Techniques for Amazon EC2 Deployments on AWSAmazon Web Services
 
Amazon EC2 Systems Manager for Hybrid Cloud Management at Scale
Amazon EC2 Systems Manager for Hybrid Cloud Management at ScaleAmazon EC2 Systems Manager for Hybrid Cloud Management at Scale
Amazon EC2 Systems Manager for Hybrid Cloud Management at ScaleAmazon Web Services
 
NEW LAUNCH! Additional transparency and control for your AWS environment thro...
NEW LAUNCH! Additional transparency and control for your AWS environment thro...NEW LAUNCH! Additional transparency and control for your AWS environment thro...
NEW LAUNCH! Additional transparency and control for your AWS environment thro...Amazon Web Services
 
Automated DevOps Workflows with Chef on AWS
Automated DevOps Workflows with Chef on AWSAutomated DevOps Workflows with Chef on AWS
Automated DevOps Workflows with Chef on AWSAmazon Web Services
 
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)Amazon Web Services
 
Improving Infrastructure Governance on AWS by Henrik Johansson, Solutions Ar...
 Improving Infrastructure Governance on AWS by Henrik Johansson, Solutions Ar... Improving Infrastructure Governance on AWS by Henrik Johansson, Solutions Ar...
Improving Infrastructure Governance on AWS by Henrik Johansson, Solutions Ar...Amazon Web Services
 
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar SeriesImproving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar SeriesAmazon Web Services
 
SMC304 Serverless Orchestration with AWS Step Functions
SMC304 Serverless Orchestration with AWS Step FunctionsSMC304 Serverless Orchestration with AWS Step Functions
SMC304 Serverless Orchestration with AWS Step FunctionsAmazon Web Services
 
Breaking down the economics and tco of migrating to aws - Toronto
Breaking down the economics and tco of migrating to aws - TorontoBreaking down the economics and tco of migrating to aws - Toronto
Breaking down the economics and tco of migrating to aws - TorontoAmazon Web Services
 
Application Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldApplication Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldAmazon Web Services
 
(DVO313) Building Next-Generation Applications with Amazon ECS
(DVO313) Building Next-Generation Applications with Amazon ECS(DVO313) Building Next-Generation Applications with Amazon ECS
(DVO313) Building Next-Generation Applications with Amazon ECSAmazon Web Services
 
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar SeriesGetting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar SeriesAmazon Web Services
 
SEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS Organizations
SEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS OrganizationsSEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS Organizations
SEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS OrganizationsAmazon Web Services
 
AWS Enterprise Summit Netherlands - WorkSpaces & WorkMail
AWS Enterprise Summit Netherlands - WorkSpaces & WorkMailAWS Enterprise Summit Netherlands - WorkSpaces & WorkMail
AWS Enterprise Summit Netherlands - WorkSpaces & WorkMailAmazon Web Services
 
Configuration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech TalksConfiguration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech TalksAmazon Web Services
 
Scaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million UsersScaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million UsersAmazon Web Services
 
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...Amazon Web Services
 

Was ist angesagt? (20)

Building CI-CD Pipelines for Serverless Applications
Building CI-CD Pipelines for Serverless ApplicationsBuilding CI-CD Pipelines for Serverless Applications
Building CI-CD Pipelines for Serverless Applications
 
SMC303 Real-time Data Processing Using AWS Lambda
SMC303 Real-time Data Processing Using AWS LambdaSMC303 Real-time Data Processing Using AWS Lambda
SMC303 Real-time Data Processing Using AWS Lambda
 
DevOps on AWS: Advanced Techniques for Amazon EC2 Deployments on AWS
DevOps on AWS: Advanced Techniques for Amazon EC2 Deployments on AWSDevOps on AWS: Advanced Techniques for Amazon EC2 Deployments on AWS
DevOps on AWS: Advanced Techniques for Amazon EC2 Deployments on AWS
 
Amazon EC2 Systems Manager for Hybrid Cloud Management at Scale
Amazon EC2 Systems Manager for Hybrid Cloud Management at ScaleAmazon EC2 Systems Manager for Hybrid Cloud Management at Scale
Amazon EC2 Systems Manager for Hybrid Cloud Management at Scale
 
NEW LAUNCH! Additional transparency and control for your AWS environment thro...
NEW LAUNCH! Additional transparency and control for your AWS environment thro...NEW LAUNCH! Additional transparency and control for your AWS environment thro...
NEW LAUNCH! Additional transparency and control for your AWS environment thro...
 
AWS OpsWorks for Chef Automate
AWS OpsWorks for Chef AutomateAWS OpsWorks for Chef Automate
AWS OpsWorks for Chef Automate
 
Automated DevOps Workflows with Chef on AWS
Automated DevOps Workflows with Chef on AWSAutomated DevOps Workflows with Chef on AWS
Automated DevOps Workflows with Chef on AWS
 
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
 
Improving Infrastructure Governance on AWS by Henrik Johansson, Solutions Ar...
 Improving Infrastructure Governance on AWS by Henrik Johansson, Solutions Ar... Improving Infrastructure Governance on AWS by Henrik Johansson, Solutions Ar...
Improving Infrastructure Governance on AWS by Henrik Johansson, Solutions Ar...
 
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar SeriesImproving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
 
SMC304 Serverless Orchestration with AWS Step Functions
SMC304 Serverless Orchestration with AWS Step FunctionsSMC304 Serverless Orchestration with AWS Step Functions
SMC304 Serverless Orchestration with AWS Step Functions
 
Breaking down the economics and tco of migrating to aws - Toronto
Breaking down the economics and tco of migrating to aws - TorontoBreaking down the economics and tco of migrating to aws - Toronto
Breaking down the economics and tco of migrating to aws - Toronto
 
Application Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldApplication Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless World
 
(DVO313) Building Next-Generation Applications with Amazon ECS
(DVO313) Building Next-Generation Applications with Amazon ECS(DVO313) Building Next-Generation Applications with Amazon ECS
(DVO313) Building Next-Generation Applications with Amazon ECS
 
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar SeriesGetting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
 
SEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS Organizations
SEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS OrganizationsSEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS Organizations
SEC302 Becoming an AWS Policy Ninja using AWS IAM and AWS Organizations
 
AWS Enterprise Summit Netherlands - WorkSpaces & WorkMail
AWS Enterprise Summit Netherlands - WorkSpaces & WorkMailAWS Enterprise Summit Netherlands - WorkSpaces & WorkMail
AWS Enterprise Summit Netherlands - WorkSpaces & WorkMail
 
Configuration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech TalksConfiguration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech Talks
 
Scaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million UsersScaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million Users
 
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
 

Ähnlich wie Monitoring Modern Applications: Introduction to AWS X-Ray

Monitoring modern applications: Introduction to AWS xray
Monitoring modern applications: Introduction to AWS xrayMonitoring modern applications: Introduction to AWS xray
Monitoring modern applications: Introduction to AWS xrayAmazon Web Services
 
NEW LAUNCH! Introduction to AWS X-Ray
NEW LAUNCH! Introduction to AWS X-RayNEW LAUNCH! Introduction to AWS X-Ray
NEW LAUNCH! Introduction to AWS X-RayAmazon Web Services
 
AWS Lambda support for AWS X-Ray
AWS Lambda support for AWS X-RayAWS Lambda support for AWS X-Ray
AWS Lambda support for AWS X-RayEitan Sela
 
Tools. Techniques. Trouble?
Tools. Techniques. Trouble?Tools. Techniques. Trouble?
Tools. Techniques. Trouble?Testplant
 
Raleigh DevDay 2017: Distributed serverless stack tracing and monitoring
Raleigh DevDay 2017: Distributed serverless stack tracing and monitoringRaleigh DevDay 2017: Distributed serverless stack tracing and monitoring
Raleigh DevDay 2017: Distributed serverless stack tracing and monitoringAmazon Web Services
 
Distributed Serverless Stack Tracing and Monitoring - DevDay Austin 2017
Distributed Serverless Stack Tracing and Monitoring - DevDay Austin 2017Distributed Serverless Stack Tracing and Monitoring - DevDay Austin 2017
Distributed Serverless Stack Tracing and Monitoring - DevDay Austin 2017Amazon Web Services
 
From Zero to Serverless
From Zero to ServerlessFrom Zero to Serverless
From Zero to ServerlessChad Green
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...Amazon Web Services
 
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...Amazon Web Services
 
Structured Functional Automated Web Service Testing
Structured Functional Automated Web Service TestingStructured Functional Automated Web Service Testing
Structured Functional Automated Web Service Testingrdekleijn
 
Distributed Serverless Stack Tracing and Monitoring
Distributed Serverless Stack Tracing and MonitoringDistributed Serverless Stack Tracing and Monitoring
Distributed Serverless Stack Tracing and MonitoringAmazon Web Services
 
Deep-Dive to Application Insights
Deep-Dive to Application Insights Deep-Dive to Application Insights
Deep-Dive to Application Insights Gunnar Peipman
 
Cloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a CacheCloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a Cachecornelia davis
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Securitysedukull
 
Tech Talk on Cloud Computing
Tech Talk on Cloud ComputingTech Talk on Cloud Computing
Tech Talk on Cloud ComputingITviec
 

Ähnlich wie Monitoring Modern Applications: Introduction to AWS X-Ray (20)

Monitoring modern applications: Introduction to AWS xray
Monitoring modern applications: Introduction to AWS xrayMonitoring modern applications: Introduction to AWS xray
Monitoring modern applications: Introduction to AWS xray
 
Introduction to AWS X-Ray
Introduction to AWS X-RayIntroduction to AWS X-Ray
Introduction to AWS X-Ray
 
Introduction to AWS X-Ray
Introduction to AWS X-RayIntroduction to AWS X-Ray
Introduction to AWS X-Ray
 
NEW LAUNCH! Introduction to AWS X-Ray
NEW LAUNCH! Introduction to AWS X-RayNEW LAUNCH! Introduction to AWS X-Ray
NEW LAUNCH! Introduction to AWS X-Ray
 
AWS Lambda support for AWS X-Ray
AWS Lambda support for AWS X-RayAWS Lambda support for AWS X-Ray
AWS Lambda support for AWS X-Ray
 
Introduction to AWS X-Ray
Introduction to AWS X-RayIntroduction to AWS X-Ray
Introduction to AWS X-Ray
 
Introduction to AWS X-Ray
Introduction to AWS X-RayIntroduction to AWS X-Ray
Introduction to AWS X-Ray
 
Tools. Techniques. Trouble?
Tools. Techniques. Trouble?Tools. Techniques. Trouble?
Tools. Techniques. Trouble?
 
Raleigh DevDay 2017: Distributed serverless stack tracing and monitoring
Raleigh DevDay 2017: Distributed serverless stack tracing and monitoringRaleigh DevDay 2017: Distributed serverless stack tracing and monitoring
Raleigh DevDay 2017: Distributed serverless stack tracing and monitoring
 
Distributed Serverless Stack Tracing and Monitoring - DevDay Austin 2017
Distributed Serverless Stack Tracing and Monitoring - DevDay Austin 2017Distributed Serverless Stack Tracing and Monitoring - DevDay Austin 2017
Distributed Serverless Stack Tracing and Monitoring - DevDay Austin 2017
 
From Zero to Serverless
From Zero to ServerlessFrom Zero to Serverless
From Zero to Serverless
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
 
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
 
Structured Functional Automated Web Service Testing
Structured Functional Automated Web Service TestingStructured Functional Automated Web Service Testing
Structured Functional Automated Web Service Testing
 
Distributed Serverless Stack Tracing and Monitoring
Distributed Serverless Stack Tracing and MonitoringDistributed Serverless Stack Tracing and Monitoring
Distributed Serverless Stack Tracing and Monitoring
 
Introduction to SignalR
Introduction to SignalRIntroduction to SignalR
Introduction to SignalR
 
Deep-Dive to Application Insights
Deep-Dive to Application Insights Deep-Dive to Application Insights
Deep-Dive to Application Insights
 
Cloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a CacheCloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a Cache
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Security
 
Tech Talk on Cloud Computing
Tech Talk on Cloud ComputingTech Talk on Cloud Computing
Tech Talk on Cloud Computing
 

Mehr von Amazon Web Services

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...Amazon Web Services
 
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...Amazon Web Services
 
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 FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
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 Amazon Web Services
 
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...Amazon Web Services
 
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...Amazon Web Services
 
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 WorkloadsAmazon Web Services
 
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 sfatareAmazon Web Services
 
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 NodeJSAmazon Web Services
 
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 webAmazon Web Services
 
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 sfatareAmazon 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 AWSAmazon 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 DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon 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
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

Mehr von 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
 

Monitoring Modern Applications: Introduction to AWS X-Ray

  • 1. Introduction to AWS X-Ray Overview and Use Cases Randall Hunt Technical Evangelist, AWS @jrhunt
  • 2. Agenda • Overview • Concepts • API • Use cases • Getting started • Demo • Q & A
  • 4. Development vs. production Traditional debugging involves: • A development environment • Search through logs for clues to reproduce the issue • Set breakpoints in code to stop execution, and inspect variables and call stack • Add additional log statements as necessary and redeploy application • Repeat until the issue is fixed Traditional process of debugging doesn’t scale well to production applications or those built using a service-oriented, microservice, or serverless architecture It’s tedious, repetitive, and time consuming
  • 5. Monolithic vs. service-oriented applications Applications traditionally developed using a monolithic architecture Move to service oriented (microservices) architecture to overcome the drawbacks of a monolithic application architecture But microservices come with their own set of challenges Benefits: • Simple to develop • Simple to test and debug • Simple to deploy • Simple to scale Drawbacks: • Hard to iterate fast • Hard to scale efficiently • CI/CD time consuming and difficult • Reliability challenges — a problem with a single component can take down the whole app
  • 6. Challenges Deploying and managing service-oriented applications is more work compared to monolithic applications 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 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
  • 7. Solution AWS X-Ray makes it easy to: • Identify performance bottlenecks and errors • Pinpoint issues to specific service(s) in your application • Identify impact of issues on users of the application • Visualize the service call graph of your application
  • 10. X-Ray SDK 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) Enables you to get started quickly without having to manually instrument your application code to log metadata about requests
  • 11. 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
  • 13. 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
  • 14. Sampling configuration • { • "rules": { • "move": { • "id": 1, • "service_name": "*", • "http_method": "*", • "url_path": "/api/move/*", • "fixed_target": 0, • "rate": 0.05 • }, • "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 five-percent sampling rate with no minimum number of requests to trace to requests with paths under /api/move The second overrides the default sampling rule with a rule that traces the first request each second and 10 percent of additional requests.
  • 15. APIs
  • 16. 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
  • 17. 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
  • 18. 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 • }
  • 19. Traced Request X-Amzn-Trace-Id: Root=1-5759e988-bd862e3fe1be46a994272793;Sampled=1 Version number Hex of epoch timestamp Optional: Parent segment ID 96 bit globally unique id for trace (24 hex digits)
  • 35. Application 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.use(XRay.express.closeSegment());
  • 36. Demo
  • 38. X-Ray pricing Free during the preview. After that: Free tier • The first 100,000 traces recorded per month are free • The first 1,000,000 traces retrieved or scanned per month are free Additional charges • Beyond the free tier, traces recorded cost $5.00 per million per month • Beyond the free tier, traces retrieved or scanned cost $0.50 per million per month
  • 39. Currently AWS Supported SDKs and Frameworks • Java • Tomcat, Spring Boot, Servlet filters • Node.js (express filters) • C# (.NET, .NET core)
  • 40. Currently (Natively) Supported Services • ELB • Lambda • API Gateway • EC2 • Elastic Beanstalk
  • 41. Available today! • The AWS X-Ray service is available in preview today. • Go to https://aws.amazon.com/xray to sign up for the preview. • 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