Skip to content

Latest commit

 

History

History
 
 

infinispan-spring-boot-samples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Infinispan Spring-Boot samples

Covers
  • ✓ Embedded cache

  • ✓ Remote cache

  • Actuator cache metrics

  • ✓ Integration with Prometheus

Building instructions

Invoke mvn clean install for the embedded or the remote example

Running instructions

Embedded

mvn spring-boot:run

Remote

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

Display actuator stats

You will see in http://localhost:8080/actuator/metrics a list of metrics available. Cache metrics are prefixed by "cache."

Display each metric for each cache using tags. For example for the 'puts' stats in the basque-names cache:

Run Prometheus

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