A RESTful service for managing person records.
- Docker and Docker Compose installed
- Start the main application and monitoring stack:
docker-compose up -d- Person Management UI: Open http://localhost:8080 in your browser to access the Person Management interface
This project includes a comprehensive monitoring and observability stack with the following components:
Grafana provides visualization dashboards for metrics, logs, and traces.
- Access Grafana: Open http://localhost:3000 in your browser
- Default credentials: admin/admin (you'll be prompted to change on first login)
- Pre-configured dashboards:
- Spring Boot Observability: Overall view of application health, performance metrics, and traces
- Spring Boot Statistics: Detailed application metrics and statistics
Prometheus collects and stores metrics from the application.
- Access Prometheus: http://localhost:9090
Loki aggregates and indexes logs from the application.
- Logs are accessible through Grafana dashboards
Tempo stores distributed traces for request tracking.
- Traces are accessible through Grafana dashboards
-
View application metrics:
- Go to Grafana at http://localhost:3000
- Navigate to the "Spring Boot Observability" or "Spring Boot Statistics" dashboards
-
Explore logs:
- In Grafana, go to Explore
- Select "Loki" as the data source
- Query logs with labels (e.g.,
{compose_service="person-api"})
-
Analyze traces:
- In Grafana, go to Explore
- Select "Tempo" as the data source
- Search for traces by service name or use trace IDs from logs
-
Correlate data:
- From metrics in dashboards, you can drill down to related logs and traces
- From logs containing trace IDs, you can click through to see the full trace
This project includes HTTP request samples that can be used with IntelliJ IDEA's HTTP Client feature. These samples demonstrate how to interact with the Person API endpoints.
- Open the file
src/main/resources/http-requests/person-api.httpin IntelliJ IDEA - Click the "Run" button next to any request to execute it
- View the response in the "Response" tab
The samples include:
- Getting all persons
- Getting a person by ID
- Creating a new person
- Updating an existing person
- Deleting a person
This project includes a k6 script for load testing the Person API. The script performs CRUD operations on person records and measures performance metrics.
# Using Homebrew
brew install k6# Using Chocolatey
choco install k6
# OR using Windows Package Manager (winget)
winget install k6
# OR download the installer from the official website
# https://k6.io/docs/get-started/installation/- Make sure the Person API is running:
docker-compose up -d- Run the k6 script:
k6 run k6-script.jsThe script will simulate user traffic according to the defined stages:
- Ramp up to 5 users over 5 seconds
- Ramp up to 15 users over 5 seconds
- Ramp up to 30 users over 5 seconds
- Stay at 30 users for 10 seconds
- Ramp down to 15 users over 5 seconds
- Ramp down to 0 users over 5 seconds
The test results will be displayed in the console, showing metrics like:
- Request duration
- Success rate
- Error counts
- HTTP request rates