A silly pet store to demonstrate SRE metrics with elastic apm. This repo used to contain deploy instructions with ansible for all apps and apm components. Now that everything is containerized on the master branch - we keep the old stuff in the native-systemd branch.
run everything in dev mode
$ docker-compose -f docker-compose-dev.yml -d up|down [-v]
First start mongo
$ docker run -d -p 127.0.0.1:27017:27017 --rm \
-v mongo:/data -v `pwd`/mongo-seed.js:/docker-entrypoint-initdb.d/mongo-seed.js \
--name mongo mongo:4.0.3
Run only pets service
# cd src/pets
$ go run ./cmd/pets -n
Run only web native
# cd src/web
$ npm run native
building images requires passing tests
# cd src/web - grabs version from package.json
$ ./build.sh
# cd src/pets - grabs version from file
$ ./build.sh
# GET /api/v1/pets
$ curl -u <credentials> localhost:9012/api/v1/pets
# POST /api/v1/pet
$ curl -u <credentials> localhost:9012/api/v1/pet -d '{"name":"pet"}' -H "Content-Type:application/json"
- do private network
- deploy and run mongodb
- mongodb metrics w metricbeat modules System, MongoDB
- hostmetrics playbook
- web-api
- service
- elastic apm on elastic cloud
- add apm agents
- deploy web and service
- let web stats end point collect stats from pets
- centralized logs
- ping/heartbeat
- elastic apm rum
- kibana dashboards
- sre dashboard in kibana
- graceful exits for http Servers and db connections
- containerize apps
- docker-composed dev
- build scripts with tests
- run on k8s
MIT