Giter Club home page Giter Club logo

prometheus-grafana-devops's Introduction

Prometheus + Grafana = Awesome Monitoring

Talk presentend at DevOps Days Florianopolis - 18/02/2017

Check out the presentation slides here: Prometheus + Grafana = Awesome Monitoring - Slide Share

This is the repository that you'll find all the files used in the demo presented!

Dependencies:

  • Vagrant >= 1.8
  • Unix/Linux Machine
  • vagrant-hostmanager (Vagrant Plugin)
  • vagrant-vbguest (Vagrant Plugin)

Checkout this docs to install vagrant and vagrant plugins:

All the Prometheus and Grafana setup runs inside of the Vagrant so you can replicate easily on any machine.

Once you got everything needed you just need to clone the repository and enter into the directory

  git clone https://github.com/dalssaso/prometheus-grafana-devops-floripa.git
  cd prometheus-grafana-devops-floripa

After that you need to start vagrant vms

  vagrant up --provisioning

It will take a while to spin up, this will start the VMs and install everything you need for running the steps, including:

  • Docker
  • Docker Compose
  • Share the files from the host machine and the vagrant machines
  • Set the hostnames and communication between them

You can see all the steps in the Vagrantfile

Prometheus Server Setup

After you get everything up and running you need to connect into the vagrant machine called prom-server

  vagrant ssh prom-server

Here comes the good part :)

All the commands that we'll need to run, we'll run inside of /vagrant directory

  • Let's start the prometheus server
  docker-compose up -d prometheus
  • After that we'll need to start the alertmanager
  docker-compose up -d alertmanager
  • After that we'll start the grafana
  docker-compose up -d grafana

Now we're good to go to our browse and check the grafana and prometheus working

Open your browser and point to: http://prom-server.example.com:3000 to check grafana

Open your browser and point to: http://prom-server.example.com:9090 to check prometheus dashboard

Now to start getting some metrics we need to start the nodeexporter

  docker-compose up -d nodeexporter

Open a new terminal session and go to the repository folder and run:

  vagrant ssh node
  cd /vagrant
  docker-compose up -d nodeexporter

You'll start getting metrics from to servers!

Grafana Dashboard Setup

Prometheus DataSource

Open Grafana Dashboard on your browser (http://prom-server.example.com:3000)

The default user and pass is: admin

Click in the Grafana Icon at Left Top Corner -> Data Source -> Add Data Source

Name Value
Name Prometheus
Type Prometheus
URL http://localhost:9090
Access proxy

Fill the form with the values above and then click Add

Node Explorer Dashboard

Click in the Home -> Import -> Upload .json file select the node_grafana_template.json

Select the Prometheus Datasource that we just added Click and Add and you're good to go

You have all set! Now you just need to play around :D

Checking the configuration files

  • alert.rules - configuration file when we configure the rules to the alerts
  • alertmanager.yml - configuration file for the alertmanager service
  • prometheus.yml - configuration file for the prometheus server service

For further learning of Prometheus check the its docs here

Destroy the environment

  cd prometheus-grafana-devops-floripa
  vagrant destroy -f

prometheus-grafana-devops's People

Contributors

dalssaso 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.