Spring Petclinic app to demo Grafana o11y - logs, metrics, traces
Simple Spring Boot application to demonstrate collecting and correlating logs, metrics and traces with Prometheus, OpenTelemetry, and Grafana Cloud. It is built using Maven.
You can run the whole stack locally inside Docker, after building the application container. The whole stack contains:
- The Pet Clinic application
- The simple load runner
- Prometheus for metrics
- Loki for logs
- Tempo for traces
- Grafana Agent to collect logs, metrics and traces
- Grafana
git clone adamquan/petclinic-grafana-o11y
cd petclinic-grafana-o11y
./mvnw package
docker build -t spring-petclinic .
cd local
docker-compose up
After all the containers are up, you can access the appliction here: http://localhost:8080/, and Grafana here: http://localhost:3000
Go to dashboards, and open the PetClinic dashboard, you will see something beautiful!
The dashboard has a few different rows/sections. The first section is an application overview section:
The second section shows span metrics automatically generated by Tempo:
The last section shows the metrics generated from logs and raw logs:
You can also run the application locally, but send logs, metrics and traces to Grafana Cloud. You do need to configure the cloud/config/agent.yaml
file with your Grafana Cloud information. Local components that starts inside Docker include:
- The Hello Observability application
- The simple load runner
- Grafana Agent to collect logs, metrics and traces
The architecture looks like:
cd hello-observability/cloud
docker-compose up
Import the dashboard from the dashboard.json
file,
Similary as you have done locally, import the dashboard and enjoy!
Here is a live version of the dashboard
Exemplar was added by following this blog