Mini Node Exporter

ℹ️ 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.

📌 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

  2. Adding Metrics In Grafana

  3. Graph of node_uptime in Grafana dashboard

  4. Graph of average load at 1m

  5. Graph of average load at 5m

  6. Graph of average load at 15m