Skip to content

Springboot sending log to Elastic Search by EFK (Elastic Search + Fluentd/Filebeat + Kibana)

Notifications You must be signed in to change notification settings

trevezani/fluentd-springboot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fluentd-springboot

The full example is present in microservices-tutorial-springboot


Building and Running

  • building:
mvn clean package -f api-zipcode
mvn docker:build -f api-zipcode/api-zipcode-infraestructure
  • running:
docker-compose -f compose/docker-compose.yml up

Links: [Elastick Search] [Kibana]

Once running, you can call:

curl http://localhost:1401/zipcode/37188
  • checking the memory
docker stats $(docker ps --format={{.Names}})

Results

kibana_logs.png

kibana_discover.png

console_curl.png

console_stats.png


Building and Running (Kubernetes mode)

For this test is necessary has a docker registry with login and password set to admin:admin and a minikube installed.

  • building:
mvn clean package -f api-zipcode

mvn -Ddocker.registry=localhost:5000 -Ddocker.username=admin -Ddocker.password=admin docker:build docker:push -f api-zipcode/api-zipcode-infraestructure
  • preparing the environment in the kubernetes:

In the file deployment.yaml the image needs be change

kubectl create -f kubernates/namespace.json

kubectl create secret docker-registry service-registry --namespace=census --docker-server=$(ipconfig getifaddr en0):5000 --docker-username=admin --docker-password=admin

kubectl apply -f kubernetes/deployment.yaml
kubectl apply -f kubernetes/service.yaml
kubectl apply -f kubernetes/ingress.yaml

kubectl create namespace logging

kubectl apply -f kubernetes/elastic.yaml
kubectl apply -f kubernetes/kibana.yaml

Two ways to transport the log to the elasticsearch: Fluentd and Filebeat. Choose one.

kubectl apply -f kubernetes/fluentd.yaml
kubectl apply -f kubernetes/filebeat.yaml

Link: [Kibana]

Once running, you can call:

curl http://census.trevezani.com.br/zipcode/37188

Releases

No releases published

Packages

No packages published