init prometheus

This commit is contained in:
Kameron Kenny 2024-06-05 16:42:13 -04:00
commit 70210f891d
No known key found for this signature in database
GPG Key ID: E5006629839D2276
4 changed files with 83 additions and 0 deletions

40
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,40 @@
pipeline {
agent {
label 'pi501.in.thelinuxpro.net'
}
stages {
stage("verify tooling") {
steps {
sh '''
docker version
docker info
docker compose version
'''
}
}
stage('Create contexts') {
steps {
sh 'docker context ls | grep pi502 || docker context create pi502 --docker "host=ssh://pi502.in.thelinuxpro.net"'
}
}
stage('Start container') {
steps {
script {
def status_s = sh(returnStatus: true, script: 'grep $(docker --context pi502 compose ps | tail -n1 | awk \'{ print $2 }\') docker-compose.yml')
if (status_s != 0) {
sh 'docker --context pi502 compose up -d'
sh 'docker --context pi502 compose ps'
} else {
echo 'skip'
}
}
}
}
}
}

0
README.md Normal file
View File

22
docker-compose.yml Normal file
View File

@ -0,0 +1,22 @@
networks:
infra_dev_net:
external: true
volumes:
prom_data:
driver: local
services:
prometheus:
image: prom/prometheus
container_name: prometheus
command: '--config.file=/etc/prometheus/prometheus.yml'
restart: unless-stopped
ports:
- '9090:9090'
volumes:
- ./prometheus:/etc/prometheus
- prom_data:/prometheus
networks:
infra_dev_net:
ipv4_address: 10.99.23.32

21
prometheus/prometheus.yml Normal file
View File

@ -0,0 +1,21 @@
global:
scrape_interval: 15s
scrape_timeout: 10s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets: []
scheme: http
timeout: 10s
api_version: v1
scrape_configs:
- job_name: prometheus
honor_timestamps: true
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- localhost:9090