AWS X-Ray – Great weapon for Developer in 2020

  • by

AWS X-Ray is a service developed by AWS that enables developers to conduct performance analysis and debug distributed micro-service-based applications.

AWS X-Ray – What is it?

AWS X-Ray makes it easy for developers to analyze the behavior of their production, distributed applications with end-to-end tracing capabilities. Leveraging all the data Amazon gathered since the release of their cloud computing services, they had all the necessary information to develop AWS X-Ray and release it in November 2016.

There has been no easy way for developers to “follow-the-thread” as execution traverses EC2 instances, ECS containers, micro services, AWS database and messaging services.

Jeff Barr, Amazon Web Services

You can use X-Ray to identify:

  • performance bottlenecks
  • edge case errors
  • other hard to detect issues

Feature of AWS X-Ray

AWS X-Ray has various features. We’re noting them down below for your better understanding.

  • Simple setup
    • It can be integrated easily with many services like EC2, ECS, Lambda and Elastic Beanstalk.
  • End-to-end tracing
    • AWS X-Ray provides an end-to-end cross platform view of request made to your applications. It can be integrated easily with EC2, ECS, Lambda and Elastic Beanstalk. The X-Ray SDK captures metadata for requests made to MySQL and PostgreSQL databases (self-hosted, Amazon RDS, Amazon Aurora), and Amazon DynamoDB. It also captures metadata for requests made to Amazon Simple Queue Service and Amazon Simple Notification Service.
    • It can support the application written in programming language like Node.js, Java, and .NET.
    • You can set the trace sampling rate that is best suited for your production applications or applications in development. X-Ray continually traces requests made to your application and stores a sampling of the requests for your analysis. This provides you with the appropriate amount of data to make your analysis meaningful, while avoiding the overhead of storing and managing excessive data volume.
  • Service map
    • Creates a map of services used by your application with trace data that you can use to drill into specific services or issues.
    • Provides a view of connections between services in your application.
  • Server- and Client-side latency detection
    • AWS X-Ray allows you to visually detect node and edge latency distribution directly from the service map.
  • Data annotation and filtering
    • You can use this to append business-specific metadata.
    • You can also view and filter data for traces by properties such as annotation value, average latencies, HTTP response status, timestamp, database table used etc.
  • Console and programmatic access
    • You can use Amazon X-Ray with the AWS Management Console, AWS CLI, and AWS SDKs. The X-Ray API lets you programmatically access the service so you can easily export trace data or ingest the data into your own tools and custom analytics.
  • Secure
    • AWS X-Ray is integrated with AWS Identity and Access Management (IAM) so that you can control which users and resources have permission to access your traces and how.

X-Ray Workflow

AWS X-Ray operates on an intuitive workflow that progresses as follows:

  • Collect traces
    • X-Ray collects data from each underlying service of an application. To form an end-to-end trace, it adds an HTTP header to requests that do not already have one and passes the header along to additional tiers of request handlers.
  • Record Traces
    • AWS X-Ray complies all the gathered data into traces which span from the beginning of your application workflow to the end.
  • View Service Map
    • X-Ray creates a map of services used by the application using the trace data. This provides a visual representation of the connections between services in the application and aggregated data for each service.
  • Analyze Issues
    • After all the traces are collected and formatted into a Service map, developers are able to drill down into the service to find exactly where and what error is taking place. Developers will be able to identify performance bottlenecks, detect segments of high latency and see the numbers of occurring errors.

AWS X-Ray Disadvantages

  • This makes third-party traces end abruptly and the resulting service map to inaccurately represent the application’s architecture.
  • It is not possible to trace over the API gateway or track asynchronous invocations such as SNS on Kinesis.
  • AWS X-Ray is difficult to set up connections to developer and testing environments, or identify problems that run across multiple traces.

X-Ray Pricing

AWS X-Ray comes with free tier. The first 100,000 traces recorded each month, and free for the first 1,000,000 traces retrieved or scanned each month.

Then, traces recorded cost $5 for every 1,000,000 transactions, while traces received or scanned only cost $0.50 for every 1,000,000 transactions.

AWS Certification Exam | Practice Questions for AWS X-Ray

The questions are collected from Internet. The answers are based on my experience. Please apply your idea before you select your answer.

A company is facing performance issues with their micro services architecture deployed on AWS. Which service can help them debug and analyze the issue?

A. AWS Inspector
B. CodeDeploy
C. AWS X-Ray
D. AWS Config

Reading reference for AWS Certifications

AWS Documentation for AWS X-Ray

Developers Guide, AWS

If you find this article useful, please feel free to share and give it a like. Your comment is our inspiration. To read more such articles, please click here.

Amazon Kinesis AMI Automation AWS AWS AppStream 2.0 AWS Backup aws certifications aws certifications catalog AWS EBS AWS Elastic Transcoder AWS IAM AWS Sagemaker aws services AWS SES aws support aws swf AWS WorkSpaces AWS X-Ray Azure Cost Management Best Practices chage command Linux Cloud Computing Cloud Migration Data Science DNS Edge Computing Fog Computing Interview Preparation Jenkins Kubernetes Linux Linux User Management Microsoft Azure OSI Model Python R sample questions Server Hardening Supercomputer WordPress