= Atomikos micrometer


----

Execute application

----
mvn spring-boot:run
----

Go to the swagger-ui

----
http://localhost:8080/swagger-ui/
----

* Creating a new account with its name will commit a 2pc transaction with a db and a broker participant.

* Creating a new account with name "error" will rollback on both.

* Check the actuator for simple metrics reporting:

----
http://localhost:8080/actuator/prometheus


----

You can see more sophisticated metrics in a prometheus server:

First, edit prometheus.yml to configure your local IP address

----
docker run -d -p 9090:9090 -v <path>/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
----
where <path> is the root of your project

 Then check Grafana

----
docker run -d -p 3000:3000 grafana/grafana
----

* Open http://localhost:3000
* Login with user admin and pw admin
* Go to Configuration -> Data Sources -> Prometheus
* In the URL field type http://<your_ip_address>:9090 -> Save and test -> a green bar should appear
* Go to Create -> Dashboard
* In the "Query" tab on the Metrics field: type "transactions_seconds_sum" (for instance)

