Giter Site home page Giter Site logo

juaruipav / nomad-prometheus-playground Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 384 KB

A playground based on docker to test the hashi stack (nomad/consul) alongside Prometheus and grafana for cluster monitoring

License: Apache License 2.0

Dockerfile 28.23% Smarty 9.59% Shell 26.81% HCL 6.20% Go 29.17%

nomad-prometheus-playground's Introduction

nomad-prometheus-playground

The goal of this repository is to create a playground of a custom cluster using the hashi-stack (nomad and consul) and getting metrics automatically from prometheus in order to visualize everything using grafana

Repository structure and building

The whole functionality has been splitted into different folders representing each entity:

hashi-base-docker

This is an ubuntu18.04 based image with both Consul and Nomad binaries already installed. Just build it:

cd hashi-base-docker && docker-compose build 

cluster-client-docker

Using the previously built image, this image represent a client in the cluster that includes the Consul and Nomads services running at the same time. The variables $CONSUL_MASTER_ADDR and $NOMAD_MASTER_ADDR are configured in runtime. The telemetry stanza is configured to report nomad status to prometheus.

cd cluster-client-docker && docker-compose build 

cluster-server-docker

Same concept for the server machines. In this case, our cluster will have a single server (bootstrap_expect = 1)

cd cluster-server-docker && docker-compose build 

prometheus-scraper

We will use a golang application to create a custom metric and send it to prometheus. In this case, we will ping our client-X instances and push the RTT (time from ping command) to prometheus every 5 seconds. The docker image uses the official golang image and compiles the code and generate the binary.

cd prometheus-scraper && docker-compose build 

prometheus-docker

Using a multistage build from the original prometheus docker image, a custom image is created in order to use a template for the config file in runtime.

cd prometheus-docker && docker-compose build 

Running the example

After all the required images have been generated, just start everything from the root docker-compose.yaml file

docker-compose up

We use the default bridge network, and let the server be the first instantiated docker (172.17.0.2). From now on, the following services are available from your browser:

Screenshots

Nomad cluster

nomad

Consul cluster

consul

Prometheus targets

prometheus

Grafana Go App visualization

grafana

nomad-prometheus-playground's People

Contributors

juaruipav avatar

Stargazers

 avatar  avatar

Watchers

 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.