Autumn Sale - up to 36% OFF

Server Monitoring with Prometheus and Grafana

Server Monitoring with Prometheus and Grafana
Published on Oct 17, 2025 Updated on Oct 17, 2025

Server monitoring provides visibility into your IT environment. It enables you to track hardware and application metrics, as well as analyze trends over time. Monitoring is typically two-fold: hardware and application monitoring.

Hardware monitoring involves monitoring statistics like CPU and memory usage, filesystem health, disk I/O, uptime, and network bandwidth. Equally crucial is being able to observe your servers' security status. This calls for vulnerability assessments, malware detection, and monitoring failed login attempts, which can signal potential brute-force attacks.

Application monitoring takes a more granular approach. Diverse metrics are derived to provide insights into an application's performance and health. For a web server, you might want to gather metrics such as response times and HTTP status codes. The information gathered helps you improve performance.

#What is Prometheus?

A CNCF project, Prometheus is a widely used monitoring solution ideal for graphing and storing time-series metrics. It offers powerful querying capabilities, thanks to PromQL, which filters and aggregates data in real time. Prometheus is versatile and flexible, making it a good fit for monitoring both traditional on-premise and cloud-native environments. It's a household name in Kubernetes and is used to monitor microservices.

A notable drawback of Prometheus is its limited dashboarding capabilities. It offers a basic graphing interface for ad hoc debugging, which is not intuitive or easy to use to gain valuable insights. That brings us to the next monitoring solution.

#What is Grafana?

Grafana is a powerful & customizable dashboarding tool that transforms time-series metrics into stunning visualizations by way of charts and graphs. It aims to offer better visualization of metrics from connected data sources, which provide limited visualization capabilities. Beyond visualization, it provides powerful alerting capabilities, which send alerts to notify users when certain thresholds are exceeded.

High-Performance Dedicated Servers

Deploy custom or pre-built bare metal servers with enterprise-grade hardware, full root access, and transparent pricing. Instant provisioning, flexible billing, and 24/7 expert support.

#Prerequisites

We will configure Prometheus and Grafana on a single server. This will be sufficient to showcase how the two monitoring solutions interact. Ubuntu 24.04 will be our preferred environment.

So, ensure you have the following:

An instance of Ubuntu 24.04 with SSH access and a sudo user configured.

Prometheus and Grafana are already installed on your server instance. If not, check out how to install Prometheus and how to insall Grafana on Ubuntu.

#Step 1: Install Prometheus Node Exporter

The first step is to install the Node Exporter client. It runs on the server to retrieve server-specific metrics. The metrics are scraped and stored, upon which Grafana takes over and visualizes them.

So, download the latest binary release of Node Exporter.

Command Line
wget https://github.com/prometheus/node_exporter/releases/download/v1.9.1/node_exporter-1.9.1.linux-amd64.tar.gz

With the Node Exporter downloaded, untar it to extract its contents into a folder.

Command Line
tar -xvf node_exporter-*.tar.gz

The extraction creates a directory named node_exporter-1.9.1.linux-amd64. This contains a folder called node_exporter and a few other files. You can preview the directory contents by running the command:

Command Line
ls -l node_exporter-1.9.1.linux-amd64
Outputtotal 21700
-rw-r--r-- 1	 cherry cherry        11357	 Apr 	 1 	18:23 		LICENSE
-rw-r--r-- 1  	 cherry cherry             463          Apr 	 1 	18:23		 NOTICE
-rwxr-xr-x 1 	 cherry cherry  22204245	 Apr 	 1 	18:19		 node_exporter

You must move the node_exporter folder to the usr/local/bin location. To do so, run the command:

Command Line
sudo mv node_exporter-1.9.1.linux-amd64/node_exporter /usr/local/bin

Next, create a systemd service for Node exporter. First, create a system user.

Command Line
sudo useradd -rs /bin/false node_exporter

With the Node Exporter system user in place, create a systemd file.

Command Line
sudo vim /etc/systemd/system/node_exporter.service

Add the following lines.

Command Line
[Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target


[Service]
User=node_exporter
Group=node_exporter
Type=simple
Restart=on-failure
RestartSec=5s
ExecStart=/usr/local/bin/node_exporter

[Install]
WantedBy=multi-user.target

Save the changes and exit the text editor.

Next, reload the systemd manager configuration.

sudo systemctl daemon-reload

Start the Node Exporter service.

sudo systemctl start node_exporter

You can enable the service as follows.

sudo systemctl enable node_exporter

To confirm Node Exporter is up, run:

sudo systemctl status node_exporter

The Node Exporter service listens on TCP port 9100. Verify this by running:

Command Line
ss -pnltu | grep 9100

Visit http://server-ip:9100/metrics to view the raw statistics in plain text.

check-prometheus-raw-metrics-port-9100-browser

#Step 2: Configure Prometheus to monitor remote nodes

You need to make a few changes for Prometheus to start scraping server metrics. Therefore, access the YAML file.

Command Line
sudo vim /etc/prometheus/prometheus.yml

By default, Prometheus includes a single job called 'prometheus' in the scrape_configs section. Below that, you'll see the following lines.

 static_configs:
 - targets: ["localhost:9090"]

This section defines the endpoint. The line targets: ["localhost:9090"] specifies the target system or endpoint, in this case, the local server on port 9090. Prometheus by default listens on this port.

Directly below, create another job by adding the following lines as shown.

- job_name: "remote-node"
  static_configs:
    - targets: ["localhost:9100"]

We have created a job called remote-node. Node Exporter will scrape metrics on localhost on port 9100.

Then restart Prometheus for the changes to take effect.

Command Line
sudo systemctl restart prometheus

Afterward, visit http//server-ip:9090. Head to Status > Targets. And there, an endpoint named "remote-node" will be displayed. Click the show more blue button beside the remote-node (1/1 up) target to reveal more information about the endpoint, which is our server instance.

prometheus-node-exporter-up

#Integrating Prometheus with Grafana

The next course of action is to visualize the metrics with Grafana. However, integration with Prometheus as a data source is mandatory for this to happen. So, follow the outlined steps.

#Add Prometheus as a data source

Now, turn your attention to Grafana. Visit the URL http://server-ip:3000 and log in.

grafana-login-web-interface

The beautiful Grafana welcome page will appear. The main section is replete with useful links for basic information about Grafana. You can also access documentation and basic tutorials, and visit the community pages to stay in the loop on the latest happenings.

grafana-welcome-page The left sidebar offers numerous options for various Grafana-related tasks. You can create dashboards, add data sources, configure alerts, add new admin users, etc. We aim to connect to Prometheus, so click Connections, then select the Data sources option.

select-data-sources-grafana-side-navigation-menu

Next, click the Add data source button.

select-data-sources-option-grafana-web-interface

With over 100 data source plugins, Grafana supports many data sources, Prometheus being a favorite. A list of possible data sources will be populated. Since we are connecting to Prometheus, select Prometheus.

select-prometheus-data-source-grafana

In the section that appears, fill out the data source name (give your preferred name) and provide your Prometheus server URL as indicated.

configure-prometheus-data-source-grafana

From there, skip the default settings, scroll down, and click the Save and Test button. You should get a pop-up informing you of the successful API query. If you get an error pop-up, ensure you have provided the correct URL and port number.

save-and-test-prometheus-data-source-grafana

With the data source successfully added, the next step is to build the dashboards.

#Import a dashboard to visualize metrics

There are two approaches to creating dashboards in Grafana. You can do so manually, but this typically requires mastery and a high skill level, which may not apply to new users or novices. The second, and by far the most preferred option, is leveraging the pre-built dashboards that Grafana offers for visualizing metrics. Check them out at the Grafana dashboards page.

We will import the Node Exporter dashboard to visualize metrics from Prometheus. It provides a neat layout with panels displaying metrics on charts and graphs.

To import the dashboard, head to the Grafana dashboards page and search for the Node Exporter Full dashboard.

grafana-dashboards-page

On the right section, you will see two options for importing the dashboard. The first option lets you copy the unique ID associated with the dashboard, while the second enables you to download a JSON file. Any of these can work, but we will use the ID to import the dashboard for ease of use. So copy the ID (at the time of writing, 1860 is the Node Exporter Full dashboard ID).

grafana-dashboards-page-import-dashboard-template

For simplicity, we will use the ID to import the dashboard. So copy the ID (at the time of writing, 1860 is the Node Exporter Full dashboard ID.

Head back to Grafana and click Dashboards on the left sidebar.

grafana-select-dashboards-option

Next, click the plus [+] icon at the top right section and select the Import dashboard option.

import-grafana-dashboards-option

Paste the dashboard ID and click Load.

import-and load-grafana-dashboard-using-unique-ID-option

Select your Prometheus data source on the next page and click the Import button.

import-node-exporter-grafana-dashboard-using

You should see a neat and elaborate dashboard displaying all the system metrics on various charts and graphs in no time.

server-monitoring-with-prometheus-and-grafana

You can scroll down to view more statistics, such as disk throughput, filesystem usage, network traffic, and more.

NOTE

Having Prometheus and Grafana on a single node is only ideal for testing. This is due to scalability limitations and the pressure on computational resources arising from ingesting large amounts of data and visualizing metrics.

In addition, node failure can impact both Grafana and Prometheus, leading to the loss of precious metrics and visualizations. A single point of failure widens the attack surface such that if a node is compromised, all your data is at the mercy of the attacker.

In that regard, we recommend installing the two on separate servers for optimal performance and efficiency, especially in enterprise environments.

And that's it. We have explored how to monitor a server with Prometheus and Grafana.

#Conclusion

Grafana and Prometheus are an excellent, powerful setup for monitoring servers and applications. The two complement each other to offer a robust and reliable monitoring solution. Both tools are open-source and free to install (Grafana has an Enterprise product for enhanced monitoring). Zero licensing fees make Prometheus and Grafana a perfect choice for personal use, small businesses, and even large companies.

In this guide, we explored the integration of Prometheus and Grafana. We added Prometheus as a data source to Grafana and used Grafana's prebuilt dashboards to visualize the server's metrics. We hope you replicate the same steps by selecting one of our fast and scalable virtual servers. You can monitor as many servers as you like by adding multiple Prometheus data sources from different servers.

Cloud VPS Hosting

Starting at just $3.24 / month, get virtual servers with top-tier performance.

Share this article

Related Articles

Published on Oct 14, 2025 Updated on Oct 14, 2025

Top 7 Dedicated Server Providers in Germany

Discover the best dedicated server hosting providers in Germany. Learn why Germany’s GDPR compliance, fast connectivity, and strong infrastructure make it ideal.

Read More
Published on Oct 8, 2025 Updated on Oct 8, 2025

5 Benefits of Renting a Dedicated Server

Learn the 5 key benefits of renting a dedicated server: consistent performance, full control, strong security, and predictable costs for continuous workloads.

Read More
Published on Sep 25, 2025 Updated on Sep 26, 2025

How Long Do Cloud Outages Really Last?

In this research we analyzes cloud outages incident reports from the three largest cloud providers GCP, AWS, and Microsoft Azure, between Aug 18, 2024 and Aug 17, 2025.

Read More
We use cookies to ensure seamless user experience for our website. Required cookies - technical, functional and analytical - are set automatically. Please accept the use of targeted cookies to ensure the best marketing experience for your user journey. You may revoke your consent at any time through our Cookie Policy.
build: db1264843.1432