Monitor Your Systems with Prometheus and Grafana: A Setup Guide

Hào Võ · Updated Nov 19, 2026

Giám Sát Hệ Thống Hiệu Quả với Prometheus và Grafana: Hướng Dẫn Chi Tiết

System monitoring is essential for performance, stability and security in modern IT environments. Tools such as Prometheus and Grafana provide a complete solution for collecting and analysing data from different systems. This guide shows how to set up and optimise system monitoring with Prometheus and Grafana, from the basics to advanced features.

Quick answer: Prometheus collects and stores metrics (as time series) and Grafana builds dashboards from that data: the standard pair for monitoring servers, containers and applications. Basic setup: (1) install Prometheus and declare scrape targets in prometheus.yml; (2) install an exporter on each machine to monitor (node_exporter for Linux, windows_exporter for Windows, cAdvisor for Docker); (3) install Grafana, add Prometheus as a data source and import a ready-made dashboard (for example Node Exporter Full, ID 1860); (4) install Alertmanager to send alerts by email, Slack or Telegram based on rules. The quickest way to try it is a Docker Compose stack with Prometheus, Grafana and node_exporter.

Why does system monitoring matter?

Monitoring gives you the information needed to optimise resources and detect problems quickly. Unmonitored systems can suffer data loss, downtime and poor performance. With monitoring in place, businesses respond to incidents faster, keep services available and protect user data.

Prometheus: an open-source monitoring platform

Prometheus is an open-source project for collecting and storing metrics as time series. It can monitor distributed services and offers a powerful query language (PromQL) and API. Prometheus uses a pull model, regularly scraping data from endpoints and storing it in its own database. Its architecture makes it easy to scale and integrate with existing applications.

What is Grafana?

Grafana is a powerful data visualisation platform for building custom dashboards from many data sources, including Prometheus. You can create clear charts, track performance and analyse data in real time, helping IT engineers spot problems and make data-driven decisions.

Installing Prometheus and Grafana step by step

Installing Prometheus

  1. Download Prometheus from the official website (prometheus.io).
  2. Create a prometheus.yml configuration file defining the targets to monitor.
  3. Start Prometheus with ./prometheus --config.file=prometheus.yml.
  4. Check the web interface at http://localhost:9090.

Installing Grafana

  1. Download Grafana from the official website and extract it (or install the package for your OS).
  2. Start Grafana with ./bin/grafana server (older versions: ./bin/grafana-server web).
  3. Open Grafana at http://localhost:3000.
  4. Sign in with the default credentials (admin/admin) and change the password immediately.

Configuring Prometheus to collect data

Prometheus with Node Exporter

Node Exporter is a lightweight agent that collects system information such as CPU, memory and disk. To set it up:

  1. Install Node Exporter on the server to monitor.
  2. Add the Node Exporter target to prometheus.yml.
  3. Restart or reload Prometheus to apply the new configuration.
scrape_configs:
  - job_name: "node"
    static_configs:
      - targets: ["192.168.1.10:9100"]

Monitoring Docker containers

To monitor Docker containers, use cAdvisor:

  1. Run cAdvisor as a Docker container.
  2. Add cAdvisor to the Prometheus configuration to track container activity.
  3. Adjust the scrape interval to suit your monitoring needs.

Monitoring databases (MySQL, PostgreSQL)

Use the matching exporters to collect database metrics:

  1. Install MySQL Exporter (mysqld_exporter) or PostgreSQL Exporter (postgres_exporter).
  2. Add the exporters to prometheus.yml.

Building effective dashboards in Grafana

Common chart types

Create time series (line) charts, bar charts, gauges or heatmaps to display metrics. Choose the chart type that best suits the data you want to track.

Customising dashboards

Grafana dashboards can be customised with colours, sizes, thresholds and panel layouts, so users can follow key indicators at a glance.

Alerting with Prometheus

Alerting is essential so incidents are detected in time.

  1. Define the conditions you want to alert on (alerting rules).
  2. Configure Prometheus to send alerts to Alertmanager.
  3. Set up how alerts are delivered: email, or chat tools such as Slack or Telegram.

Best practices

  • Configure Prometheus correctly so it collects all the data you need, and set retention to match your storage.
  • Build clear, simple dashboards focused on the most important metrics.
  • Review and update alerts regularly to avoid alert fatigue.
  • Document the setup for your team so they can use the tools effectively.

By following these steps and tuning your monitoring with Prometheus and Grafana, you can keep systems stable and performing at their best. For managed server monitoring for your business, see our IT Support service or contact IT Systems at hotline 028.3995.03.59 or contact@itsystems.com.vn.

FAQ

What are the roles of Prometheus and Grafana?

Prometheus collects and stores time-series metrics and evaluates alert rules; Grafana turns the data into dashboards and can send alerts.

Can Prometheus monitor Windows servers?

Yes. Install windows_exporter so Prometheus collects CPU, RAM, disk and service data; Linux hosts use node_exporter.

Does a small business need its own monitoring?

If it runs servers, a NAS or key internal services, basic monitoring and alerts help catch full disks, stopped services or overload early.

Need someone to run your servers, NAS and systems?

IT Systems manages servers, NAS, cloud, backup and user accounts on a schedule, with a monthly operations report.

IT system management services · Call +84 28 3995 0359

Request adviceChat on ZaloCall hotline