Sample spring boot application with some config files for POC of the Elastic APM Stack.
Execute the steps bellow:
- Create a sample SpringBoot application
- Download the library "apm-agent-attach-1.7.0.jar" from https://search.maven.org/search?q=g:co.elastic.apm%20AND%20a:apm-agent-attach&core=gav
- Run up the containers
$docker-compose up
- Run the application
$ java -jar target/spring-boot-elastic-apm-0.0.1-SNAPSHOT.jar
- Get the PID of application
- Install the agent (more about configs: https://www.elastic.co/guide/en/apm/agent/java/current/intro.html)
$java -jar apm-agent-attach-1.7.0.jar --pid <pid> --config 'capture_body=all'
- Open kibana (http://localhost:5601)
- Go to the "APM" item of the left menu
- The name of the application will be displayed, click on it
- Some monitoring data will be displayed
- Send some requests
curl -X POST \
http://localhost:8080/payments/json \
-H 'Content-Type: application/json' \
-H 'X-Organization: zup' \
-d '{
"description": "Dados adicional 3GB",
"amount": 1599,
"currency": "BRL",
"creditCard": {
"type": "MASTERCARD",
"number": "5568392674344894"
},
"customer": {
"cpf": "39782928070",
"name": "Mary Doo"
}
}'