This repository contains a sample web app built using express.js and instrumented with the X-Ray SDK for Node.js. It is intended to demonstrate the tracing capabilities of the SDK by running a local website that makes a variety of downstream requests. An HTTP downstream request, AWS SDK request, and MySQL query are demonstrated in the app.
- The X-Ray Daemon installed and running on your local machine
- NPM and Node 10+ installed
- Clone this repo to your local machine
- Navigate into the repository
- Run
npm install
- Run
node index.js
to run the webapp onlocalhost
- Go to
localhost:3000
in your browser of choice, and play around with the sample app!
NOTE: the sample app uses the us-west-2
region by default, but you can override that by setting the AWS_DEFAULT_REGION
environment variable.
These steps are only necessary if you'd like to see the MySQL demo in the sample app. If you already have a MySQL environment set up, you can skip to step 4.
- Set up a MySQL server
- Follow this tutorial to create a MySQL database
- Follow this tutorial to create a table in that database
- Populate
mysql-config.json
with the required information - Go to the sample app in your browser to experience the MySQL tracing demo!
Please consult the official AWS Documentation for general questions about the X-Ray SDK for Node.js, and the API reference for implementation-specific questions. If you notice an issue with this sample app, please open an issue. If you notice an issue with the SDK itself, please open an issue in its repository.
This library is licensed under the MIT-0 License. See the LICENSE file.