Skip to content

A mini replica of Prometheus's node_exporter where it exposes the basic CPU metrics like uptime, average load, hostname, etc.

License

Notifications You must be signed in to change notification settings

CIPHERTron/mini-node-exporter

Repository files navigation

Mini Node Exporter

A mini replica of prometheus/node-exporter where it exposes the basic CPU metrics like uptime, average load, hostname, etc.

Link to the Image published on Dockerhub 🚀

Table of Contents
  1. About The Project
  2. Built With
  3. Getting Started
  4. Relevant Screenshots

ℹ️ About The Project

Mini Node Exporter is the simplest form of the famous prometheus/node_exporter. It is basically a type of monitoring stack and an exporter for hardware and OS metrics that is exposed by the prom-client. The express, prometheus & grafana servers are containerized using Docker & the whole monitoring stack is orchestrated using Docker Compose.

Grafana Dashboard plotting metrics

🛠️ Built With

Following technologies and libraries are used for the development of this project.

📌 Getting Started

To setup the project locally follow the steps below

💻 Prerequisites

🤖 Running the project.

To set this up in the local repository:

  1. Fork and clone the project to your local system
  2. Copy the commands below:
docker-compose up -d --build mini-node-exporter
docker-compose up -d --build prometheus
docker-compose up -d --build grafana
  1. Now, there will be three processes running on your system i.e. mini-node-exporter, prometheus, grafana. mini-node-exporter will be running at 0.0.0.0:23333 whereas prometheus will be running at 0.0.0.0:9090 and grafana at 0.0.0.0:3000.

  2. The mini-node-exporter application will be having the endpoints as follows:

  • /info/uptime - Displays the Uptime of the server
  • /info/load - Displays the average load of the system in 1m, 5m and 15m in the form of a JSON.
  • /metrics is the endpoint which exposes two gauge metrics i.e node_load & node_uptime
  1. To fetch the metrics, open your terminal & run curl -GET 0.0.0.0:23333/metrics. This will return all the default as well as custom metrics.
  2. Open 0.0.0.0:9090/graph to view the Prometheus dashboard.
  3. To view the grafana dashboard, open 0.0.0.0:3000
  4. A valid data source that goes by the name of Prometheus is already configured.
  5. Now, plot a graph on the Grafana dashboard by the metrics scraped from Prometheus i.e.
  • Follow the standard way of adding a new Grafana graph.
  • Click the graph title, then click "Edit".
  • Under the "Metrics" tab, select your Prometheus data source (bottom right).
    Example mertics: node_uptime, node_load_1m, node_load_5m & node_load_15m
  • Enter any Prometheus expression into the "Query" field, while using the "Metric" field to lookup metrics via autocompletion.
  • To format the legend names of time series, use the "Legend format" input. For example, to show only the method and status labels of a returned query result, separated by a dash, you could use the legend format string {{method}} - {{status}}.
  • Tune other graph settings until you have a working graph.

📉 Relevant Screenshots:

  1. Prometheus up & running Prometheus Config

  2. Adding Metrics In Grafana Adding Metrics In Grafana

  3. Graph of node_uptime in Grafana dashboard Grafana Dashboard

  4. Graph of average load at 1m Grafana Dashboard

  5. Graph of average load at 5m Grafana Dashboard

  6. Graph of average load at 15m Grafana Dashboard

About

A mini replica of Prometheus's node_exporter where it exposes the basic CPU metrics like uptime, average load, hostname, etc.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published