This is a test application used to genearte data for the talk at the OpenJS World 2021.
Disclaimer: It can be used as a guideline for setting up metrics and dev envirnoment with Prometheus and Grafana, but this service does not have many of the characteristics you want in a production-ready service. Please DO NOT use it in production.
This setup was made to work with MacOS and only tested on MacOS Catalina.
- make sure you have docker desktop installed and on the latest version
- run the
./setup-docker.sh
script (WARN this script will remove existing containers)
cd app
npm install
npm start
Within the app
folder, the following npm
scripts are available:
npm start
: starts the servernpm restart
: restarts the servernpm stop
: stops the servernpm baseline-load
: uses autocannon to send a baseline load to the/echo
endpointnpm load
: short for autocannon (you should use autocannon parameters)
Please notice:
- The metrics might take a coupe minutes to show once the server is started.
- Some metrics will require the baseline-load to run for a couple minutes before they appear.
Steps:
- Go to Grafana (http://localhost:3001)
- login with credentials
admin:admin
- select the OpenJS World Dashboard from the Dashboards panel
npm install
fails:- maybe you need XCode command line tools installed?
./setup-docker.sh
fails:- open the file and try to execute each command independently on your shell.