This Javascript Sample App will emit Traces and Metrics. There are two types of metrics emitted; Request Based and Random Based. Metrics are generated as soon as the application is ran or deployed without any additional effort. These are considered the random based metrics which track a mock of TimeAlive, TotalHeapSize, ThreadsActive and CpuUsage. The boundaries for these metrics are standard and can be found in the configuration file (YAML) called config.yaml.
Additionally, you can generate Traces and request based Metrics by making requests to the following exposed endpoints:
- /
- Ensures the application is running
- /outgoing-http-call
- Makes a HTTP request to aws.amazon.com (http://aws.amazon.com/)
- /aws-sdk-call
- Makes a call to AWS S3 to list buckets for the account corresponding to the provided AWS credentials
- /outgoing-sampleapp
- Makes a call to all other sample app ports configured at
<host>:<port>/outgoing-sampleapp
. If none available, makes a HTTP request to www.amazon.com (http://www.amazon.com/)
- Makes a call to all other sample app ports configured at
- Non-conformance: This SDK language is not missing any features or extensions required other than Resource Detectors
- Workarounds: No workarounds are being used in this application
In order to run the application
- Clone the repository
git clone https://github.com/aws-observability/aws-otel-community.git
- Switch into the directory
cd sample-apps/javascript-sample-app
- Install dependencies
npm install
- Run the javascript server
node index.js
Now the application is ran and the endpoints can be called at0.0.0.0:8080/<one-of-4-endpoints>
.
In order to build the Docker image and run it in a container
- Build the image
docker build -t javascript-sample-app .
- Run the image in a container
docker run -p 8080:8080 javascript-sample-app