Example application using Akka HTTP and Akka Persistence with Mesmer instrumentation.
Run docker-compose up
in the docker
directory.
This will set up everything needed by the application:
- PostgreSQL database with Akka Persistence Journal
- OpenTelemetry Collector - that will receive metrics from the application
- Prometheus - that will receive the metrics from the collector
To run the application with default settings:
sbt "project example" runWithAgent
You can now interact with the application to generate some traffic and metrics:
- Get account balance:
curl -X GET http://localhost:8080/api/v1/account/{UUID}/balance
- Deposit funds:
curl -X POST http://localhost:8080/api/v1/account/{UUID}/deposit/100
- Withdraw funds:
curl -X POST http://localhost:8080/api/v1/account/{UUID}/withdraw/100
If the account with the given UUID doesn't exist, it will be automatically created.