Skip to content

sandokandias/learning-springboot-elastic-apm

Repository files navigation

spring-boot-elastic-apm

Sample spring boot application with some config files for POC of the Elastic APM Stack.

Execute the steps bellow:

  1. Create a sample SpringBoot application
  2. 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
  3. Run up the containers
$docker-compose up
  1. Run the application
$ java -jar target/spring-boot-elastic-apm-0.0.1-SNAPSHOT.jar
  1. Get the PID of application
  2. 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'
  1. Open kibana (http://localhost:5601)
  2. Go to the "APM" item of the left menu
  3. The name of the application will be displayed, click on it alt-text
  4. Some monitoring data will be displayed alt-text
  5. 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"
  }
}'
  1. Some seconds later the http request will be displayed alt-text

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published