Skip to content

pedrogalv/elk-prometheus-grafana-stack

Repository files navigation

elk-prometheus-grafana-stack

ELK + Prometheus + Grafana communication POC

This is POC to understand better how this applications communicate with each other:

  • Grafana
  • Prometheus
  • Spring Boot
    • Actuator
    • Sleuth
    • Logback
  • Elasticsearch
  • Logstash
  • Kibana
  • Zipkin
  • Graylog

First of all, increase linux virtual allowed space

$ sudo sysctl -w vm.max_map_count=262144

Endpoints

Service Address
Demo localhost:8080
Elasticsearch localhost:9200
Grafana localhost:3000
Graylog localhost:9000
Kibana localhost:5601
Logstash localhost:9600
MongoDB localhost:27017
Prometheus localhost:9090
Zipkin localhost:9411

Steps

  • Open file prometheus.yml, on the last line change the spring-actuator target IP to your local IP (this will be fixed soon :) )
  • Start the Spring Boot demo app with cd demo && ./gradlew bootRun
  • Start docker-compose with docker-compose -d up)
    • Be patient, wait at least 5 minutes so all the services have plenty of time to comunicate with each other and setup the initial configuration. Grab a cup of coffee or tea or water or something more powerful :)
    • docker ps should list 8 services up
  • Check if prometheus target 'spring-actuator' is up
  • Open Graylog with user admin, password admin
    • Go to System -> Inputs
    • Select input "GELF UDP" and Launch, fill it with:
      • Check the ckeckbox Global
      • Title: UDP
      • Bind address: 0.0.0.0
      • Port: 12201
      • Save
    • Again select input "GELF UDP" and Launch, fill it with:
      • DONT check the ckeckbox Global
      • Title: ELK Stack UDP
      • Bind address: 0.0.0.0
      • Port: 12202
      • Save
  • Call the Spring Boot demo app at least once to generate a log curl http://localhost:8080/info
  • Create the index micro-* in Kibana with timefield @timestamp
  • Open Grafana dashboard with user admin, password secret
  • Go to Configuration->Datasources, "Add data source", choose ElasticSearch and input:
  • Again go to Configuration->Datasources, "Add data source", choose Prometheus and input:
  • Import the Grafana dashboard file grafana-dash.json
  • Keep hitting http://localhost:8080/info, http://localhost:8080/warn and http://localhost:8080/error to check logs in Kibana/Graylog and numbers in Grafana. Also checkout Zipkin for the tracing.

Done!

License

MIT

Free Software, Hell Yeah!

About

ELK + Prometheus + Grafana communication POC

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •