System Monitoring Setup Guide

System Monitoring Setup Guide

Overview

System monitoring involves continuously tracking the performance, health, and security of a computer system to ensure it operates efficiently. Effective monitoring typically includes:

  • Resource Utilization (CPU, memory, storage, network)

  • Performance Metrics (response times, throughput)

  • Health Checks (service uptime, connectivity)

  • Logs and Alerts

  • Security Monitoring

This guide describes how to enable monitoring for an OpenMRS server for DRC, using Prometheus, Grafana, and a Prometheus metrics exporter.

Prerequisites

On the Monitoring Server

Use a dedicated machine separate from the OpenMRS server. Ensure the following are installed:

  • Docker

  • Docker Swarm

  • Prometheus (for metrics collection and storage)

  • Grafana (for dashboards and visualization)

On the OpenMRS Server

Install a Prometheus exporter, such as:

  • Node Exporter – recommended for system-level metrics

Exporters expose system or application metrics in a format that Prometheus can scrape.

Setup Instructions

1. Prepare the Monitoring Server

Set up a dedicated server that will run Grafana, Prometheus, and a reverse proxy.
Do not run these services on the same machine as OpenMRS.

  1. Install Grafana & Prometheus

Grafana provides visualization and dashboards, while Prometheus collects and stores metrics.

For a quick setup, clone the DIGI monitoring repository:

git clone https://github.com/DIGI-UW/digi-monitoring.git

The repository includes ready-to-use configuration for:

  • Reverse proxy

  • Prometheus

  • Grafana

3. Start the Monitoring Stack

Inside the repository directory, run:

./mk.sh

This script deploys:

  • Reverse proxy

  • Prometheus

  • Grafana

About the Reverse Proxy:
It provides an additional security layer and hides internal service endpoints from external access.

4. Install a Metrics Exporter on the OpenMRS Server

To allow Prometheus to collect metrics, install a system metrics exporter.

Recommended: Node Exporter

Run the following on the OpenMRS server:

wget https://github.com/prometheus/node_exporter/releases/latest/download/node_exporter-*linux-amd64.tar.gz
tar xvf node_exporter-*linux-amd64.tar.gz
cd node_exporter-*
./node_exporter

Node Exporter typically listens on port 9100.

5. Configure Prometheus to Scrape the Exporter

On the monitoring server, open the Prometheus configuration file:

prometheus.yml

Add a scrape job for the OpenMRS server:

scrape_configs:

  • job_name: 'openmrs-server'

    static_configs:

  • targets: ['<OPENMRS_SERVER_IP>:9100']   # Node Exporter port

After saving the file, restart Prometheus or redeploy the monitoring stack to apply changes.

6. Validate the Setup

Perform the following checks:

A. Exporter Metrics

Visit:

http://<OPENMRS_SERVER_IP>:9100/metrics

B. Prometheus UI

Visit:

http://<MONITORING_SERVER_IP>:9090

C. Grafana Dashboard

Visit:

http://<MONITORING_SERVER_IP>:3000

(Default login: admin:admin, unless changed.)

From Grafana, you may import dashboards for:

  • Node Exporter

  • Application-level metrics (if applicable)

Conclusion

After completing the setup, your monitoring environment will:

  • Collect metrics from the OpenMRS server

  • Store time-series data in Prometheus

  • Display visual dashboards in Grafana

  • Provide insights into system performance, health, and availability

This monitoring setup ensures proactive detection of issues and supports reliable operation of the OpenMRS platform.