re-folder

This commit is contained in:
Greg Hendrickson
2023-10-19 20:17:07 -07:00
parent 927667531c
commit 2e5761dded
4 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,113 @@
version: "3"
# Define a custom network for the services to communicate with each other
networks:
jenk_prom_graf_lab:
driver: bridge
# Define the services that will be run in the containers
services:
# Grafana service
grafana:
image: grafana/grafana:latest
container_name: grafana
volumes:
# Mount the Grafana plugins directory to the container
- /opt/docker/grafana/plugins:/var/lib/grafana/plugins
# Mount the Grafana data directory to the container
- grafana_data:/opt/docker/grafana/data
ports:
# Expose the Grafana service on port 3000
- 3000:3000
networks:
# Connect the Grafana service to the custom network
- jenk_prom_graf_lab
restart: unless-stopped
# Prometheus service
prometheus:
image: prom/prometheus:latest
container_name: prometheus
volumes:
# Mount the Prometheus data directory to the container
- prometheus_data:/opt/docker/prometheus/data
# Mount the Prometheus configuration directory to the container
- /opt/docker/prometheus/data/config:/etc/prometheus
command:
# Specify the Prometheus configuration file
- '--config.file=/etc/prometheus/prometheus.yml'
# Specify the Prometheus data directory
- '--storage.tsdb.path=/opt/docker/prometheus/data/config'
# Specify the Prometheus console libraries directory
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
# Specify the Prometheus console templates directory
- '--web.console.templates=/usr/share/prometheus/consoles'
ports:
# Expose the Prometheus service on port 9090
- 9090:9090
networks:
# Connect the Prometheus service to the custom network
- jenk_prom_graf_lab
restart: unless-stopped
# InfluxDB service
influxdb:
image: influxdb:1.8.6-alpine
container_name: influxdb
volumes:
# Mount the InfluxDB data directory to the container
- influxdb_data:/opt/docker/influxdb/data
ports:
# Expose the InfluxDB service on port 8086
- 8086:8086
networks:
# Connect the InfluxDB service to the custom network
- jenk_prom_graf_lab
restart: unless-stopped
# Jenkins service
jenkins:
image: jenkins/jenkins:lts-jdk11
container_name: jenkins
volumes:
# Mount the Jenkins data directory to the container
- jenkins_data:/opt/docker/jenkins/data
# Mount the Jenkins plugins directory to the container
- /opt/docker/jenkins/plugins:/var/jenkins_home/plugins
ports:
# Expose the Jenkins service on port 8080
- 8080:8080
# Expose the Jenkins service on port 50000
- 50000:50000
networks:
# Connect the Jenkins service to the custom network
- jenk_prom_graf_lab
restart: unless-stopped
# Define the volumes that will be used by the services
volumes:
jenkins_data:
driver_opts:
# Mount the Jenkins data directory as a bind mount
type: none
device: /opt/docker/jenkins/data
o: bind
grafana_data:
driver_opts:
# Mount the Grafana data directory as a bind mount
type: none
device: /opt/docker/grafana/data
o: bind
influxdb_data:
driver_opts:
# Mount the InfluxDB data directory as a bind mount
type: none
device: /opt/docker/influxdb/data
o: bind
prometheus_data:
driver_opts:
# Mount the Prometheus data directory as a bind mount
type: none
device: /opt/docker/prometheus/data
o: bind

View File

@@ -0,0 +1,80 @@
# Jenkins Dashboard
## Host Online Check
- `jenkins_node_online_value`:
- 1: up (green)
- 0: down (red)
## Time Series Metrics
### Number of Jenkins Executors
- `jenkins_executor_count_value`
### Number in Queue
- `jenkins_queue_size_value`
### Number of Nodes
- `jenkins_node_count_value`
## Individual Stat Panels
### Plugins Active
- `jenkins_plugins_active`
### Inactive Plugins
- `jenkins_plugins_inactive`
### Plugins with Updates
- `jenkins_plugins_withUpdates`
## Set Variables in Dashboard for Dropdown
-- SHOW TAG VALUES FROM job WITH KEY = "owner"
-- SHOW TAG VALUES FROM job WITH KEY = repo WHERE "owner" =~ /^($folder)$/
## Overall Panel
## Successful Build Countsz
-- SELECT count(build_number) FROM "jenkins_data" WHERE ("project_name" =~ /^(?i)$job$/ AND "project_path" =~ /.*(?i)$folder.*$/) AND ("build_result" = 'SUCCESS' OR "build_result" = 'CompletedSuccess' ) AND $timeFilter
## Failed Build Counts
-- SELECT count(build_number) FROM "jenkins_data" WHERE ("project_name" =~ /^(?i)$job$/ AND "project_path" =~ /.*(?i)$folder.*$/) AND ("build_result" = 'FAILURE' OR "build_result" = 'CompletedError' ) AND $timeFilter
## Aborted Build Counts
-- SELECT count(build_number) FROM "jenkins_data" WHERE ("project_name" =~ /^(?i)$job$/ AND "project_path" =~ /.*(?i)$folder.*$/) AND ("build_result" = 'ABORTED' OR "build_result" = 'Aborted' ) AND $timeFilter
## Unstable Build Counts
-- SELECT count(build_number) FROM "jenkins_data" WHERE ("project_name" =~ /^(?i)$job$/ AND "project_path" =~ /.*(?i)$folder.*$/) AND ("build_result" = 'UNSTABLE' OR "build_result" = 'Unstable' ) AND $timeFilter
## Number of Pipelines Ran
-- SELECT count(DISTINCT project_name) FROM jenkins_data WHERE ("project_name" =~ /^(?i)$job$/ AND "project_path" =~ /.*(?i)$folder.*$/) AND $timeFilter
## Total Number of Builds
-- SELECT count(build_number) FROM "jenkins_data" WHERE ("project_name" =~ /^(?i)$job$/ AND "project_path" =~ /.*(?i)$folder.*$/) AND $timeFilter
## Average Build Time
-- SELECT build_time/1000 FROM jenkins_data WHERE ("project_name" =~ /^(?i)$job$/ AND "project_path" =~ /.*(?i)$folder.*$/) AND $timeFilter
## Latest Build Status
-- SELECT build_result FROM "jenkins_data" WHERE ("project_name" =~ /^(?i)$job$/ AND "project_path" =~ /.*(?i)$folder.*$/) AND $timeFilter ORDER BY time DESC LIMIT 1
## Build Details - Table
-- SELECT "build_exec_time","project_path","build_number","build_causer","build_time","build_result" FROM "jenkins_data" WHERE ("project_name" =~ /^(?i)$job$/ AND "project_path" =~ /.*(?i)$folder.*$/) AND $timeFilter
## Data Links for Build Details Table:
http://your-ip:8080/job/${__data.fields["project_path"]}/${__data.fields["build_number"]}
## Value Map Regex
Find: /(/)/g
Replace with: /job$1

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

File diff suppressed because it is too large Load Diff