Right from the time when Grace Hopper coined the term "debugging", developers and QA teams have been busy scouring through thousands of lines of code finding out errors and bugs. In the traditional waterfall software development environment, the testing procedures were confined to a single repository of code. However, the cloud computing and virtualization technologies have brought heterogeneous networks and Internet of Things (IoT) into picture.
While every resource is virtualized and moved to the cloud, monolithic software development is moving towards the microservices architecture.
The microservices architecture that is combined with asynchronous and notification-based architectures in the cloud works with platforms consisting of hundreds and thousands of moving parts. This execution traverses through containers, dockers, database service, messaging services, application services and computing instances.
And, tracing the requests and analysing performance bottlenecks to improve the system is a challenge. Amazon offers a perfect solution to this challenge.
AWS X-Ray: What is it anyway?
AWS X-Ray is a powerful tool offered by Amazon that enables developers to debug production and distributed applications, especially in the microservices architecture. By analyzing the performance of the application and its underlying services, developers can identify root causes of performance issues to quickly resolve them.
X-Ray can be used to track the performance of applications that are in production and in development. It works with simple three-tier applications and complexly coded microservices-based applications running with thousands of services. It is similar to OpenTracing API, Twitter Zipkin and Google Dapper.
AWS X-Ray can be used with Amazon EC2, Amazon Elastic Beanstalk, Amazon EC2 Container Service. It supports applications written in Node.js, .NET and Java. It traces requests made to MySQL, PostgreSQL and Amazon DynamoDB and supports services such as Amazon Simple Notification Service and Amazon Simple Queue Service.
How does AWS X-Ray work?
To set up AWS X-ray, you'll need to integrate the AWS X-Ray SDK with the application and install the X-Ray agent. With AWS Elastic Beanstalk, getting started is even simpler as the X-Ray is already pre-installed. So, you have to only integrate the AWS X-Ray SDK with the application.
- X-Ray provides an end-to-end application execution
- AWS X-Ray traces the requests made to the application.
- The data that passes through each component and service of the
application is recorded.
- The entire data from each service is organized into single units
- Displays the topological service map in a graphical format
Developers can check these traces for latency issues, metadata and HTTP statuses. Services that record unusual behaviour can be further drilled down to identify root causes of performance issues. You can use the CLI, AWS Management Console and the AWS SDKs to view traces.
Using the X-Ray API, you can import trace data into customized analytics dashboards or export data to other tools as well. For higher security, AWS X-Ray is integrated with AWS Identity and Access Management which means you can provide privilege-based access to traced data.
How does AWS X-Ray help developers?
AWS X-Ray makes it easy to developers to create a service map, identify bugs and quickly resolve them to improve the application performance.
Understanding Application Request behavior
In a complex cloud-based microservices architecture wherein multiple platforms are integrated and thousands of services are running simultaneously, understanding the behaviour of application requests is a challenge for developers.
AWS X-Ray provides clear insights into application requests with end-to-end view of traces to remove performance bottlenecks and improve the overall performance of the applications.
Identifying Application issues
AWS X-Ray traces how the execution traverses across all areas and underlying services of the application. To pinpoint application issues, it allows you to add annotations in the form of metadata to traces. By tagging and filtering trace data, it becomes easy to discover abnormal patterns in the execution and quickly resolve them.
Improving Application Performance
AWS X-Ray offers a web UI that displays the topological map of the traces. With a holistic view of X-Ray services map, you can easily view how each service and resource is interacting within the application. This end-to-end view enables you to identify latency patterns so that services that are demanding higher latencies can be modified to improve the overall performance of the application.
One tool for many applications
AWS X-Ray works a variety of applications. Be it a simple application or a microservices architecture-based complex one, AWS X-Ray makes it easy
for developers to trace the execution across the application. And, application requests can be traced across multiple AWS platforms, regions or Zones.
As AWS X-Ray is running in the preview mode right now, there is no charge to use this service. However, you would be charged for the resources used in the application that is being debugged. X-Ray comes in a pay-per-use model. There are no upfront fees. The charges are based on the number of traces scanned, recorded or retrieved. First 100,000 traces recorded, retrieved or scanned in a month are free. Beyond this
tier, there is a charge of $5 per million traces recorded in a month and $0.50 per million traces retrieved and scanned per month.
For more information, check out the AWS X-ray page.
Join the Jar Tippers on Patreon
It takes a lot of time to write detailed blog posts like this one. In a single-income family, this blog is one way I depend on to keep the lights on. I'd be eternally grateful if you could become a Patreon patron today!Become a Patron!