new launch! introduction to aws x-ray

39
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Abhishek Singh, Principal Product Manager December 1, 2016 DEV316 NEW LAUNCH! Introduction to AWS X-Ray Overview and Use Cases

Upload: amazon-web-services

Post on 06-Jan-2017

213 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: NEW LAUNCH! Introduction to AWS X-Ray

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Abhishek Singh, Principal Product Manager

December 1, 2016

DEV316

NEW LAUNCH!

Introduction to AWS X-RayOverview and Use Cases

Page 2: NEW LAUNCH! Introduction to AWS X-Ray

What to expect from the session

• Overview

• Use cases

• Getting started

• Demo

Page 3: NEW LAUNCH! Introduction to AWS X-Ray

Debugging applications

Page 4: NEW LAUNCH! Introduction to AWS X-Ray

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

Page 5: NEW LAUNCH! Introduction to AWS X-Ray

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

Page 6: NEW LAUNCH! Introduction to AWS X-Ray

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

Page 7: NEW LAUNCH! Introduction to AWS X-Ray

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

Page 8: NEW LAUNCH! Introduction to AWS X-Ray

How does X-Ray help?

Page 9: NEW LAUNCH! Introduction to AWS X-Ray

X-Ray service

Page 10: NEW LAUNCH! Introduction to AWS X-Ray

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

Page 11: NEW LAUNCH! Introduction to AWS X-Ray

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

Page 12: NEW LAUNCH! Introduction to AWS X-Ray

Concepts

Page 13: NEW LAUNCH! Introduction to AWS X-Ray

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

Page 14: NEW LAUNCH! Introduction to AWS X-Ray

APIs

Page 15: NEW LAUNCH! Introduction to AWS X-Ray

X-Ray API

X-Ray provides a set of APIs to enable you to send, filter,

and retrieve trace data

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

Page 16: NEW LAUNCH! Introduction to AWS 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

Page 17: NEW LAUNCH! Introduction to AWS X-Ray

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

}

Page 18: NEW LAUNCH! Introduction to AWS X-Ray

Use cases

Page 19: NEW LAUNCH! Introduction to AWS X-Ray

Visualize service call graph

Page 20: NEW LAUNCH! Introduction to AWS X-Ray

Identify impact

Page 21: NEW LAUNCH! Introduction to AWS X-Ray

Identify impact

Page 22: NEW LAUNCH! Introduction to AWS X-Ray

Identify performance bottlenecks

Page 23: NEW LAUNCH! Introduction to AWS X-Ray

Identify performance bottlenecks

Page 24: NEW LAUNCH! Introduction to AWS X-Ray

Identify performance bottlenecks

Page 25: NEW LAUNCH! Introduction to AWS X-Ray

Identify performance bottlenecks

Page 26: NEW LAUNCH! Introduction to AWS X-Ray

Pinpoint issues

Page 27: NEW LAUNCH! Introduction to AWS X-Ray

Pinpoint issues

Page 28: NEW LAUNCH! Introduction to AWS X-Ray

Pinpoint issues

Page 29: NEW LAUNCH! Introduction to AWS X-Ray

Getting started

Page 30: NEW LAUNCH! Introduction to AWS X-Ray

Agent installation (Amazon EC2 Linux)

Page 31: NEW LAUNCH! Introduction to AWS X-Ray

Agent Installation (Amazon EC2 Windows)

Page 32: NEW LAUNCH! Introduction to AWS X-Ray

Agent installation (Amazon ECS)

Page 33: NEW LAUNCH! Introduction to AWS X-Ray

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());

Page 34: NEW LAUNCH! Introduction to AWS X-Ray

Demo

Page 35: NEW LAUNCH! Introduction to AWS X-Ray

Pricing

Page 36: NEW LAUNCH! Introduction to AWS X-Ray

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

Page 37: NEW LAUNCH! Introduction to AWS X-Ray

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

Page 38: NEW LAUNCH! Introduction to AWS X-Ray

Thank you!

Page 39: NEW LAUNCH! Introduction to AWS X-Ray

Remember to complete

your evaluations!