Operations 8 min read

How to Set Up Prometheus, Grafana, and Node Exporter for Monitoring

This guide explains the core concepts of logging, metrics, and tracing in micro‑service monitoring, introduces Prometheus, exporters, and Grafana, and provides step‑by‑step instructions for downloading, installing, configuring, and visualizing metrics using these tools.

Full-Stack Internet Architecture
Full-Stack Internet Architecture
Full-Stack Internet Architecture
How to Set Up Prometheus, Grafana, and Node Exporter for Monitoring

Related Concepts

Monitoring in micro‑services is divided into three categories based on scope: Logging , Metrics , and Tracing .

Logging records discrete events such as application debug or error messages; tools like the ELK stack are built on logging.

Metrics capture aggregatable data, e.g., queue depth or HTTP request counters; Prometheus focuses on the metrics domain.

Tracing records information across request boundaries, showing the execution path and latency of remote calls; common solutions include SkyWalking, Pinpoint, and Zipkin.

We will now focus on Prometheus monitoring and the key components involved.

Prometheus

Prometheus, originally developed by SoundCloud, is an open‑source monitoring and alerting system with a time‑series database (TSDB). It is written in Go and is the open‑source version of Google’s BorgMon.

Prometheus works by periodically scraping HTTP endpoints exposed by monitored components. Any component that provides an HTTP exporter can be monitored without additional SDKs. Exporters are HTTP interfaces that expose metrics in a format Prometheus understands.

Exporter

An exporter is a data‑collection component that gathers metrics from a target system and presents them on an HTTP endpoint for Prometheus to scrape. Unlike traditional agents, exporters do not push data; they wait for Prometheus to pull. Numerous ready‑made exporters are available on the official GitHub repository.

Grafana

Grafana is a visualization tool that can read data from many sources, including Prometheus, and display it using attractive charts and dashboards. Its relationship to Prometheus is similar to Kibana’s relationship with Elasticsearch.

Environment Preparation

Before configuring, download the following software (the original source links are slow, so a download manager is recommended):

Prometheus

Grafana

Node Exporter

Installation

Prometheus

Run the following shell commands to install and start Prometheus:

tar zxvf prometheus-2.13.1.linux-amd64.tar.gz
mv prometheus-2.13.1.linux-amd64 prometheus
cd prometheus
nohup ./prometheus &

After startup, open http://192.168.249.131:9090 in a browser to verify the UI.

Grafana

Install and start Grafana with:

tar grafana-6.4.3.linux-amd64.tar.gz
cd grafana-6.4.3
nohup ./grafana-server &

Access Grafana at http://192.168.249.131:3000 . The default credentials are admin/admin; you will be prompted to change the password on first login.

Node Exporter

Install and start Node Exporter using:

tar zxvf node_exporter-0.18.1.linux-amd64.tar.gz
mv node_exporter-0.18.1.linux-amd64 node_exporter
nohup ./node_exporter &

Node Exporter listens on port 9100 by default; you can change it with --web.listen-address=":9200" . Verify by opening http://192.168.249.129:9100/ in a browser.

Configuration

Prometheus

Edit the prometheus.yml file in the Prometheus installation directory to add a new scrape job for the exporter host (e.g., server-192.168.249.129 ). A complete example configuration is shown below:

# my global config
global:
  scrape_interval:     15s  # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s  # Evaluate rules every 15 seconds. The default is every 1 minute.

# Alertmanager configuration
alerting:
  alertmanagers:
  - static_configs:
    - targets:
      # - alertmanager:9093

rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"

scrape_configs:
  # The job name is added as a label `job=
` to any timeseries scraped from this config.
  - job_name: 'prometheus'
    static_configs:
    - targets: ['localhost:9090']

  - job_name: '192.168.249.129'
    static_configs:
    - targets: ['192.168.249.129:9100']

After updating the configuration, restart Prometheus and verify that the new target appears in the UI.

Grafana

Configure Prometheus as a data source.

Search the Grafana dashboard marketplace for a Node Exporter dashboard and import it.

After importing, you should see live metrics from the exporter.

At this point, the Prometheus‑based monitoring environment is fully set up and ready for use.

monitoringmetricsPrometheusInstallationGrafanaExporterNode Exporter
Full-Stack Internet Architecture
Written by

Full-Stack Internet Architecture

Introducing full-stack Internet architecture technologies centered on Java

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.