mini-node-exporter
mini-node-exporter copied to clipboard
A mini replica of Prometheus's node_exporter where it exposes the basic CPU metrics like uptime, average load, hostname, etc.
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
-
About The Project
- Built With
-
Getting Started
- Prerequisites
- Running the project
- 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.
đ ī¸ Built With
Following technologies and libraries are used for the development of this project.
- Express.js
- Prometheus
- Grafana
- Docker
- Docker Compose
- Shell/CLI
đ Getting Started
To setup the project locally follow the steps below
đģ Prerequisites
đ¤ Running the project.
To set this up in the local repository:
- Fork and clone the project to your local system
- Copy the commands below:
docker-compose up -d --build mini-node-exporter
docker-compose up -d --build prometheus
docker-compose up -d --build grafana
-
Now, there will be three processes running on your system i.e.
mini-node-exporter,prometheus,grafana.mini-node-exporterwill be running at0.0.0.0:23333whereasprometheuswill be running at0.0.0.0:9090andgrafanaat0.0.0.0:3000. -
The
mini-node-exporterapplication 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./metricsis the endpoint which exposes two gauge metrics i.enode_load&node_uptime
- To fetch the
metrics, open your terminal & runcurl -GET 0.0.0.0:23333/metrics. This will return all the default as well as custom metrics. - Open
0.0.0.0:9090/graphto view the Prometheus dashboard. - To view the grafana dashboard, open
0.0.0.0:3000 - A valid data source that goes by the name of
Prometheusis already configured. - 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:
-
Prometheus up & running

-
Adding Metrics In Grafana

-
Graph of node_uptime in Grafana dashboard

-
Graph of average load at 1m

-
Graph of average load at 5m

-
Graph of average load at 15m
