Configuring AWS X-Ray Debugging
You can use the AWS Elastic Beanstalk console or a configuration file to run the AWS X-Ray daemon on the instances in your environment. AWS X-Ray is an AWS service that gathers data about the requests that your application serves, and uses it to construct a service map that you can use to identify issues with your application and opportunities for optimization.
AWS X-Ray provides an SDK that you can use to instrument your application code, and a daemon application that relays debugging information from the SDK to the X-Ray API.
You can use the AWS X-Ray SDK with the following Elastic Beanstalk platform configurations:
Java 8 - version 2.3.0 and later
Java 8 with Tomcat 8 - version 2.4.0 and later
Node.js - version 3.2.0 and later
Windows Server - all configurations starting December 9th, 2016
To be able to upload data to X-Ray, the X-Ray daemon requires IAM permissions in the AWSXrayWriteOnlyAccess managed policy. These permissions are included in the Elastic Beanstalk instance profile. If you don't use the default instance profile, see Giving the Daemon Permission to Send Data to X-Ray.
Debugging with AWS X-Ray requires the use of the AWS X-Ray SDK. See the AWS X-Ray Developer Guide for instructions and sample applications.
If you use a platform configuration that doesn't include the daemon, you can still run it with a script in a configuration file. For more information, see Running the X-Ray Daemon on AWS Elastic Beanstalk in the AWS X-Ray Developer Guide.
You can enable the AWS X-Ray daemon on a running environment in the Elastic Beanstalk console.
To enable debugging in the Elastic Beanstalk console
Open the Elastic Beanstalk console.
Navigate to the management page for your environment.
In the Software Configuration section, choose .
For X-Ray Daemon, choose Enabled.
You can also enable this option during environment creation. For more information, see The Create New Environment Wizard.
The aws:elasticbeanstalk:xray Namespace
You can use the
XRayEnabled option in the
aws:elasticbeanstalk:xray namespace to enable debugging.
To enable debugging automatically when you deploy your application, set the option in a configuration file in your source code, as follows.
option_settings: aws:elasticbeanstalk:xray: XRayEnabled: true