Git Product home page Git Product logo

elk-prometheus-grafana-stack's Introduction

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!

elk-prometheus-grafana-stack's People

Contributors

cantonio-cit avatar pedrogalv avatar karluqs avatar pedrosilva-cit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.