Production Grade Jenkins Monitoring with Prometheus, Grafana, InfluxDB

Table of contents
- Checkout this repository for more details and source codeout this repository for more details and source code
- π¦ Stack Components
- βοΈ Setup Using Docker
- π InfluxDB Setup for Jenkins Metrics
- π Jenkins Configuration
- π§ Global Configuration
- π Jenkins + Grafana + InfluxDB Dashboard
- COMPLETE DASHBOARD

This guide walks you through setting up a Jenkins monitoring stack using Docker only, with data visualization in Grafana, data collection in InfluxDB, and Jenkins pipelines sending metrics to Influx.
Checkout this repository for more details and source codeout this repository for more details and source code
π¦ Stack Components
Jenkins: CI/CD pipelines
InfluxDB: Time-series database for storing Jenkins metrics
Prometheus: (Optional in this stack)
Grafana: Dashboards for Jenkins metrics visualization
βοΈ Setup Using Docker
1. Prometheus
docker run -d --name prometheus-container \
-v /home/ubuntu/prometheus.yml:/etc/prometheus/prometheus.yml \
-e TZ=UTC \
-p 9090:9090 \
ubuntu/prometheus:2.33-22.04_beta
βΉοΈAdjust prometheus.yml as per your job scraping requirements.
2. Grafana
docker run -d -p 8086:8086 --name influxdb2 influxdb:1.8.6-alpine
3. InfluxDB (v1.8)
docker run -d -p 8086:8086 --name influxdb2 influxdb:1.8.6-alpine
4. Jenkins
docker run -d -p 8080:8080 --name jenkins jenkins/jenkins:lts-jdk11
π InfluxDB Setup for Jenkins Metrics
Access InfluxDB and Create Database
docker exec -it influxdb2 bash influx
Run the following commands inside the Influx shell:
CREATE DATABASE "jenkins" WITH DURATION 1825d REPLICATION 1 NAME "jenkins-retention";
SHOW DATABASES;
USE jenkins;
π Jenkins Configuration
β Required Plugins Install these plugins from Jenkins Plugin Manager:
Prometheus Plugin
InfluxDB Plugin
Job and Stage Monitoring Plugin
SETUP
π§ Global Configuration
Go to Manage Jenkins β Configure System
Scroll to InfluxDB Target
Add:
URL: http://<influx_host>:8086 Database: jenkins Custom Prefix: jenkins_data (if needed) Retention Policy: jenkins-retention
π Jenkins + Grafana + InfluxDB Dashboard
This project helps you visualize Jenkins pipeline data using Grafana dashboards powered by InfluxDB.
π§ͺ Generate Sample Data
Create folders and multiple pipelines.
Run jobs with various outcomes:
β Success
β Failure
β οΈ Unstable
π Aborted
π Grafana Dashboard Design
π Filtering & Visualization
Use templated variables for filtering:
job
,folder
,status
Create dropdowns using Influx queries like:
SHOW TAG VALUES FROM job WITH KEY = "owner";
SHOW TAG VALUES FROM job WITH KEY = repo WHERE "owner" =~ /^($folder)$/;
COMPLETE DASHBOARD
π¬ Feel free to contribute or suggest improvements!
Subscribe to my newsletter
Read articles from Mooaz Sayyed directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Mooaz Sayyed
Mooaz Sayyed
I am a everyday devops and cloud enthusiasts who is creating a community for inspiration and networking benefits.I am showcasing my skills almost every week to potential recruiters to find a perfect role in the corporate world, I am still a student in my 2nd year of BCA. So if you are a recruiter,you can reach me at sayyedmooaz@gmail.com