Giter Site home page Giter Site logo

mini-node-exporter's Introduction

mini-node-exporter

Hi, mini-node-exporter is a project as the interview for mentorship program of Chaos Mesh on LFX Mentorship 2021 fall.

You could upload your codes via GitHub(or other platform), and email me([email protected]) the repo link. Or just email me the codes by tar or zip pack.

Please finish this project before Mon, August 30, 2021 12:00 +8:00.

Overview

First of all, we do not restrict the programing language and frameworks, use any tech stack as your wish.

Build, and run an application on linux, it could expose several metrics of the host. Then use the prometheus to scrape this exporter, and draw a dashboard on grafana.

There are two goals of this small project:

  1. build a web application that exposes several metrics
  2. collect and make a dashboard for the exposed metrics

Goal 1

Build one web application called mini-node-exporter, it should listen on 0.0.0.0:23333, and expose several endpoints:

  • /info/hostname show the hostname with plain text
  • /info/uptime show the uptime of the system in seconds with plain text
  • /info/load show the load average in 1m, 5m and 15m with JSON, example {"1m": 0.57, "5m":0.80, "15m":0.77}
  • /metrics expose metrics that could be scraped by prometheus

Required metrics that should be exposed in /metrics:

  • node_load: load average, with a label for three duraion, for example:
  • node_uptime: uptime of the system in seconds

example:

# TYPE node_load gauge
node_load{duration="1m"} 0.57
node_load{duration="5m"} 0.80
node_load{duration="15m"} 0.77
# TYPE node_uptime gauge
node_uptime 9246.58

optional bonus:

  • build a docker image for the application, publish it on DockerHub, and provide the Dockerfile in the repo

Goal 2

Startup the monitoring stack of prometheus and grafana, and show these metrics on a grafana dashboard.

You should:

  • execute mini-node-exporter on your host
  • execute prometheus on your host, and configure it for collecting metrics from mini-node-exporter
  • execute grafana on your host, and configure it for using prometheus as the datasource
  • create a grafana dashboard for showing these metrics provided by mini-node-exporter, in any forms.

Please let it collector data for several minutes and take a screenshot of your grafana dashboard, email me the screenshot. :P

optional bonus:

  • orcherating the monitroing stack and mini-node-exporter application by docker-compose/vagrant/kubernetes or any other forms, provides the manifest files in the repo

References

some information that might be helpful:

Other

Happy Coding!

mini-node-exporter's People

Contributors

strrl avatar

Stargazers

 avatar  avatar  avatar

Watchers

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