This repository contains the code from the book for Chapter 12, Monitoring Your Applications: Observability in the Java Ecosystem. See the main book page for the list of all chapter specific repositories.
In this repository, all code is in the main branch in one folder. It is a sample Spring application used for working with the tools in the chapter.
If you want to use an IDE, import the repository as a Maven project so you have the proper dependencies.
If you want to use the command line, cd to the directory for that example and run
mvn clean verify
java -jar target/observability-0.0.1-SNAPSHOT.jar
The following Docker commands are mentioned in the chapter and included here for easy copy/pasting:
docker pull prom/node-exporter
docker run --name=node_exporter -p 9100:9100 prom/node-exporter
docker pull prom/prometheus
docker run --name prometheus -p 9090:9090 -v .\prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
docker run --name prometheus -p 9090:9090 -v ./prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
Following is a sample request.json payload for the Spring Boot MVC project:
Request type: POST
URL: http://localhost:8081/mtg/payment
Json Body:
[
{
"user": {
"name": "John Jones",
"location": "Miami, Florida"
},
"principal": 250000,
"years": 30,
"interest": 6.5
},
{
"user": {
"name": "Mary Michaels",
"location": "New York, NY"
},
"principal": 100000,
"years": 30,
"interest": 6.25
}
]Prometheus
- Prometheus documentation
- Prometheus and Linux Node Exporter
- Windows Exporter
- Node Exporter flags
- Windows Exporter flags
- Alert Manager
Other Tools