Once you compile your Spring Boot project, a dashboard for each available process plus a global one will be generated under the path target/resources/dashboards/
. You can then inject those Grafana dashboards during the deployment of the Grafana instance.
The use case is summarized in the following schema:
To summarize, the kogito app will expose by default an endpoint /actuator/prometheus
with the prometheus variables, and a prometheus instance will simply fetch the data from there.
Kogito currently exports one operational dashboard per process, which contains:
There's also a Global operational dashboard that contains the same graphs but with aggregated metrics for all the process types.
You can use these default dashboards, or you can personalize them and use your custom dashboards.
It is possible to use docker-compose
to demonstrate how to inject the generated dashboards in the volume of the Grafana container:
mvn clean package
to build the project and generate dashboards.docker compose up
to start the applications.The volumes of the Grafana container are properly set in the docker-compose.yml
file, so that the dashboards are automatically loaded at startup.
To access the dashboards simply open http://localhost:3000/ on your browser once the containers are started.
The first time it may take a few seconds for the Grafana container to start and load everything, so if you can't see the web UI immediately, try waiting 30 seconds.
Once the service is up and running, you can use the following examples to interact with the service.
Allows to create a new order with the given data:
curl -d '{"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}}' -H "Content-Type: application/json" -X POST http://localhost:8080/orders
or on windows
curl -d "{\"approver\" : \"john\", \"order\" : {\"orderNumber\" : \"12345\", \"shipped\" : false}}" -H "Content-Type: application/json" -X POST http://localhost:8080/orders
As response the updated order is returned.
Returns list of orders currently active:
curl -X GET http://localhost:8080/orders
As response an array of orders is returned.
Returns order with given id (if active):
curl -X GET http://localhost:8080/orders/1
As response a single order is returned if found, otherwise 404 Not Found is returned.
Cancels order with given id
curl -X DELETE http://localhost:8080/orders/1
Getting order items sub processes
curl -X GET http://localhost:8080/orderItems
Example response:
[ { "id":"66c11e3e-c211-4cee-9a07-848b5e861bc5", "order": { "orderNumber":"12345", "shipped":false, "total":0.537941914075738 } } ]
Getting user tasks details awaiting user action
curl -X GET http://localhost:8080/usertasks/instance?user=john
Example response:
[ { "id": "bcbe9d60-4847-45f0-8069-e983f3f055e6", "userTaskId": "UserTask_1", "status": { "terminate": null, "name": "Reserved" }, "taskName": "Verify order", ... ]
Complete user task
curl -X POST "http://localhost:8080/usertasks/instance/{taskId}/transition?user=john" -H "content-type: application/json" -d '{"transitionId": "complete","data": {"approve": true}}'
As response the updated order is returned.
Example response:
{ "id": "bcbe9d60-4847-45f0-8069-e983f3f055e6", "userTaskId": "UserTask_1", "status": { "terminate": "COMPLETED", "name": "Completed" }, "taskName": "Verify order", "taskDescription": null, "taskPriority": "1", "potentialUsers": [ "john" ], "potentialGroups": [], "adminUsers": [], "adminGroups": [], "excludedUsers": [], "externalReferenceId": "eeae84c0-234d-472f-9fa0-004a2cf34cdc", "actualOwner": "john", "inputs": { "input1": { "orderNumber": "12345", "shipped": false, "total": 0.8903945184162633 } }, "outputs": { "approve": true }, ... }