Skip to content

Latest commit

 

History

History
56 lines (37 loc) · 1.47 KB

README.md

File metadata and controls

56 lines (37 loc) · 1.47 KB

Mesmer Example Applications

Setup

Run docker-compose up in the docker directory.

This will set up everything needed by the application:

  • PostgresSQL database with Akka Persistence Journal
  • OpenTelemetry Collector that will receive metrics from the application
  • Prometheus that will receive the metrics from the collector and will allow to display them in the simplest form
  • Grafana. It's an extra dashboard that uses metrics gathered in Prometheus to display something more useful than bare data (Averages, Requests per second etc). It shows graphs based both on Mesmer-provided (Akka Persistence + Actor Metrics) and OpenTelemetry-provided metrics (Akka Http).

Run the application (both Akka and ZIO examples)

sbt "project example" runExampleWithOtelAgent

or (for Akka Streaming example)

sbt "project example" runStreamExampleWithOtelAgent

or (for ZIO 2.0.0 example)

sbt "project example" runZioExampleWithOtelAgent

In case you are running the non-streaming example: call the endpoints

You can now interact with the application to generate some traffic and metrics:

  1. Get account balance:
curl -X GET http://localhost:8080/api/v1/account/{UUID}/balance
  1. Deposit funds:
curl -X POST http://localhost:8080/api/v1/account/{UUID}/deposit/100
  1. 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.