Covers
-
✓ Embedded cache
-
✓ Remote cache
-
✓ Actuator cache metrics
-
✓ Integration with Prometheus
Use docker or download and run the Infinispan Server
Docker
docker run -it -p 11222:11222 -e USER="Titus Bramble" -e PASS="Shambles" infinispan/server
Server
cd UNZIP_SERVER_PATH/bin/
./server.sh
mvn spring-boot:run
You will see in
a list of metrics available.
Cache metrics are prefixed by "cache."http://localhost:8080/actuator/metrics
Display each metric for each cache using tags. For example for the 'puts' stats in the basque-names cache:
The prometheus.yml
file contains the host.docker.internal binding that will allow prometheus scrap the metrics
exposed by spring actuator.
Change the YOUR_PATH
value to the folder you are running prometheus from.
Docker
docker run -d --name=prometheus -p 9090:9090 -v YOUR_PATH/infinispan-spring-boot/infinispan-spring-boot-samples/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus --config.file=/etc/prometheus/prometheus.yml