Real-time Uptime Monitoring with Uptime Kuma and Grafana

Tomer Klein
4 min readNov 23, 2023

--

Introduction

Integrating Uptime Kuma monitoring into your Grafana dashboard offers a powerful synergy, allowing you to consolidate real-time uptime data alongside other critical metrics. By seamlessly embedding Uptime Kuma’s monitoring capabilities into Grafana, you unlock a comprehensive view of your system’s health and performance in a single unified interface. This integration empowers you to make informed decisions swiftly, enhancing your ability to proactively manage and optimize service uptime effortlessly. Let’s delve into the process of adding Uptime Kuma monitoring to your Grafana dashboard for a holistic monitoring experience.

prerequisites

Integrating Uptime Kuma monitoring into your Grafana dashboard offers a powerful synergy, allowing you to consolidate real-time uptime data alongside other critical metrics. Before diving into this integration, ensure you have the following prerequisites in place:

  1. Uptime Kuma Installed and Running: Have Uptime Kuma set up and operational, either via Docker or the non-Docker method as outlined in the Uptime Kuma installation guide.
  2. Grafana Installed and Configured: Ensure Grafana is installed and properly configured to create and manage dashboards.
  3. Access Credentials: Have the necessary access credentials or APIs ready for both Uptime Kuma and Grafana for seamless integration. This can be done under API key in Uptime Kuma Settings:
Uptime Kuma API Key

By seamlessly embedding Uptime Kuma’s monitoring capabilities into Grafana, you unlock a comprehensive view of your system’s health and performance in a single unified interface. This integration empowers you to make informed decisions swiftly, enhancing your ability to proactively manage and optimize service uptime effortlessly. Let’s delve into the process of adding Uptime Kuma monitoring to your Grafana dashboard for a holistic monitoring experience.

Prometheus and Grafa configuration

Step 1: Verify we can access the Uptime Kuma metrics

Before we can start scrapping the metrics we need to verify that we can access the Uptime Kuma “/metrics”. to do that, open the browser and enter your Uptime Kuma server, ending with “/metrics”:

https://uptime.example.com/metrics

You should get a Basic Auth screen:

Uptime Kuma Metrics login

Leave the Username empty and the password is the Uptime Kuma API Key you generated and click on “Sign in”. if the password is correct you should see a screen that looks like the following:

Step 2: Configure Prometheus scrapper

After we confirm that we can access the Uptime Kuma metrics, It’s time to configure our Prometheus scrapper. For that, open your Prometheus configuration file and add the following text:

  - job_name: 'uptime'
scrape_interval: 30s
scheme: http
static_configs:
- targets: ['uptime.example.com']
basic_auth:
password: abcdefghijklmnop_qrstuvwxyz_

Don’t forget to replace the targets and passwords with your own. Save the file and restart your Prometheus instance.

Step 3: Setting up the Grafana dashboard

Grafana allows you to import dashboards using JSON files. This can be helpful for sharing dashboards or moving them between instances. Here are the steps to import a Grafana dashboard from a JSON file.

  • Open your web browser and navigate to your Grafana instance. The default URL is typically http://localhost:3000, but it may vary based on your setup.
  • If you’re not already logged in, enter your Grafana username and password to log in.
  • In the Grafana sidebar, click on the “Dashboards” icon (it looks like a bar chart).
  • Import the Dashboard JSON File:
    In the top menu of the dashboard, click on the “Import” button. It may be represented as an arrow pointing upwards.

You can select between three existing dashboards or create one of your own.

Summary

The Uptime Kuma dashboards for Grafana offer a seamless integration to consolidate real-time uptime data with other crucial metrics. They empower users to visualize system health and performance comprehensively within a single interface. These dashboards enable proactive management and optimization of service uptime effortlessly by providing a holistic monitoring experience. The setup involves accessing Uptime Kuma metrics, configuring Prometheus to scrape these metrics, and utilizing Grafana’s capability to import dashboards using JSON files. This integration aims to facilitate informed decision-making and enhance the overall monitoring of system uptime.

--

--

Tomer Klein

🚀 C#/Python Developer crafting IoT magic, fueled by open source passion. Smart homes whisperer, code contributor, and tech explorer. 🌟