ℹ️ 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-exporter
will be running at0.0.0.0:23333
whereasprometheus
will be running at0.0.0.0:9090
andgrafana
at0.0.0.0:3000
. -
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.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/graph
to 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
Prometheus
is 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