The goal of this project is to implement a Spring Boot
application, called movies-api
, and use Filebeat
& ELK Stack
(Elasticsearch
, Logstash
and Kibana
) to collect and visualize application's logs and Prometheus
& Grafana
to monitor application's metrics.
-
Spring Boot
Web Java application that exposes a REST API for managing movies. Its endpoints are displayed in the picture below.
- In a terminal, make sure you are inside
springboot-elk-prometheus-grafana
root folder- Run the following script to build the image
./docker-build.sh
-
Open a terminal and inside
springboot-elk-prometheus-grafana
root folder rundocker-compose up -d
-
Wait for Docker containers to be with status
running (healthy)
(exceptfilebeat
). To check it, rundocker-compose ps
-
movies-api
movies-api
Swagger is http://localhost:8080/swagger-ui.html -
Prometheus
Prometheus
can be accessed at http://localhost:9090 -
Grafana
Grafana
can be accessed at http://localhost:3000- In order to login, type
admin
for bothusername
andpassword
- You can skip the next screen that ask you to provide a new password
- Click
General / Home
on the top - Click
movies-api-dashboard
- In order to login, type
-
Kibana
Kibana
can be accessed at http://localhost:5601Configuration
- Access
Kibana
website - Click
Explore on my own
- In the main page, click the "burger" menu icon and, then click
Discover
- Click
Create index pattern
button - In the
Index pattern name
field, setfilebeat-*
and click> Next Step
button - In the
Time field
combo-box, select@Timestamp
and clickCreate index pattern
- Click the "burger" menu icon again and then click
Discover
to start performing searches
- Access
-
Elasticsearch
Elasticsearch
URL is http://localhost:9200Useful queries
# Check ES is up and running curl localhost:9200 # Check indexes in ES curl "localhost:9200/_cat/indices?v" # Check filebeat index mapping curl "localhost:9200/filebeat-*/_mapping" # Simple search curl "localhost:9200/filebeat-*/_search?pretty"
- To stop and remove
docker-compose
containers, network and volumes, go to a terminal and, insidespringboot-elk-prometheus-grafana
root folder, run the following commanddocker-compose down -v