Blog
WebsiteLoginFree Trial
  • 🏠PagerTree Blog
  • πŸ“£Meet the PagerTree CLI: Your New On-Call Sidekick!
  • πŸ“£OpsGenie Shutdown Announced: Why PagerTree Is Your Best Alternative in 2025
  • πŸ’ŽGetting Started With Ruby on Rails in 2024 - The Complete Development Environment Guide
  • πŸ“£WhatsApp Notifications
  • 🧠Site Reliability Engineer (SRE) Interview Questions
  • πŸ‘‘What is System Monitoring?
  • πŸ‘‘Top 5 Best PagerDuty Alternatives in 2024
  • πŸ”‘Understanding Linux File System: A Comprehensive Guide to Common Directories
  • πŸ”‘Ping Command: A Comprehensive Guide to Network Connectivity Tests
  • πŸ“œFly.io migrate-to-v2 Postgres stuck in read-only mode
  • πŸ’ŽMulti-Tenant SSO using Devise
  • ✨PromQL Cheat Sheet: A Quick Guide to Prometheus Query Language
  • πŸ”‘PowerShell Cheat Sheet: Essential Commands for Efficient Scripting
  • πŸ“£Critical Alerts for iOS and iPhone
  • πŸ“£PagerTree 4.0 is finally here!
  • πŸ’ŽRuby on Rails Polymorphic Select Dropdown
  • 🧠SRE Metrics: Availability
  • 🚨Incident Response Alert Routing
  • πŸ’ŽRuby on Rails Development Setup for Beginners
  • ✨Jekyll site to AWS S3 using GitHub Actions
  • πŸ’ŽMigrate attr_encrypted to Rails 7 Active Record encrypts
  • πŸ’ŽRuby on Rails Cheat Sheet
  • πŸ“£PagerTree Forms Integration
  • πŸ“£Public Team Calendars
  • πŸ“£Slack, Mattermost, Microsoft Teams, and Google Chat
  • πŸ“£On-call Schedule Rotations
  • πŸ“£Maintenance Windows
  • ✨Docker Commands Cheat Sheet
  • πŸͺ„Slack Channel Stakeholder Notifications
  • πŸ“£PagerTree Live Call Routing
  • 🧠The Science of On-Call
  • ✨serverless
    • 🧠What is Serverless?
    • 🧠Serverless Scales
    • 🧠Serverless Costs
    • ✨Serverless Tools and Best Practices
  • ✨Prometheus Monitoring Tutorial
Powered by GitBook
On this page
  • Setup Docker Environment
  • Build the Prometheus Stack
  • Add the Prometheus Datasource to Grafana
  • Configure Alerts
  • Create a Prometheus Integration in PagerTree
  • Modify the Alert Manager Configuration
  • Simulate an Alert Worthy Incident
  • Congrats! You’re done!

Was this helpful?

Prometheus Monitoring Tutorial

A simple 10 minute tutorial to setup a Prometheus monitoring stack. Create a Docker stack that includes Prometheus, Grafana, and AlertManager with a PagerTree integration.

PreviousServerless Tools and Best Practices

Last updated 9 months ago

Was this helpful?

In this post, I will walk you through creating a simple monitoring stack, connecting it to for pretty dashboards, and finally configuring alerts via PagerTree.

If you would like a video to follow along instead, you can see it on . You can find all the code for this stack on .

Setup Docker Environment

The first thing we’ll do is a machine up and running for this solution. This tutorial assumes you will be using Ubuntu 16.04.

Build the Prometheus Stack

Once you’ve created the Ubuntu server, run the following command in the shell terminal:

curl https://raw.githubusercontent.com/PagerTree/prometheus-grafana-alertmanager-example/master/install.sh -H 'Cache-Control: no-cache' | sudo sh; cd prometheus-grafana-alertmanager-example;

At this point you’ll have automagically deployed the entire Prometheus, Grafana, and Alert Manager stack. You can now access the Grafana dashboard from your browser at:

  • Address: http://<Host IP Address>:3000

  • Username: admin

  • Password: 9uT46ZKE

Add the Prometheus Datasource to Grafana

Grafana Dashboards

Awesome! Now if you navigate to the Dashboards in Grafana you will see data populating and some nice looking graphs.

Ping Dashboard

This dashboard monitors a couple websites for uptime.

System Monitor Dashboard

This dashboard monitors the load on the machine that is running your Prometheus stack.

Configure Alerts

Now while the dashboards are cool, it would be even cooler if we were able to get alerted when something went wrong. Luckily for us, this project will create an alert after 30 seconds of high CPU. So let’s try to make use of it.

Create a Prometheus Integration in PagerTree

  1. Click the Prometheus Logo.

  2. Fill out the following:

    1. Name

    2. Appropriate urgency for the Prometheus alerts

    3. A team alerts from Prometheus should be assigned to

  3. Click Create button

  4. Copy the endpoint URL

Ensure that for the team you are assigning alerts to, you are the Layer 1 on-call and that you have at least 1 notification method setup.

Modify the Alert Manager Configuration

Now we want to modify the alert manager configuration to make use of our PagerTree Webhook. Run the following command and make sure to replace <Your PagerTree Webhook URL> with the you copied.

./util/alertmanager-configure-pagertree.sh <Your PagerTree Webhook URL>;

After you have run the configuration script, restart the stack with the following command:

Sometimes this command fails. If it does, just run the command again.

Simulate an Alert Worthy Incident

In order for us to get an alert we’ll wan to simulate some sort of Alert Worthy Incident. From the shell terminal, run the following command:

./util/high-load.sh;

Now we’ll wait for 30 seconds or so, and if you’ve followed all the steps correctly you should get a notification saying something like Instance {{ $labels.instance }} under high load.

Congrats! You’re done!

If you are reading this give yourself a pat on the back. Good job! You’ve successfully deployed a Prometheus monitoring system, hooked it up to Grafana, and configured and alerts to go to your PagerTree account.

I like for small tutorials like this one.

If you don’t already have an account, use to create an account and get $10 in credits.

If you don’t know how to create a Digital Ocean droplet or SSH into the machine you can follow .

Since the release of Grafana 5.x, Grafana supports data sources and dashboards. We’ve updated the repo for Grafana to auto provision the Prometheus data source and dashboards. Please continue to the next section, .

Grafana Dashboards

At this point you’ll then 2 dashboards. They are pretty cool. Check them out. When your ready, head down to the .

Ping Dashboard
System Dashboard

Create a .

This project is intended just to be a quick tutorial. Before being production worthy, several should be implemented.

✨
Digital Ocean
this link
this article on Medium
new integration
security considerations
auto provisioning
Grafana Dashboards
Configure Alerts Section
Prometheus
Grafana
YouTube
Github