commit 70210f891da70e542a01b49532b261babb6bb2a1 Author: Kameron Kenny <1267885+kkenny@users.noreply.github.com> Date: Wed Jun 5 16:42:13 2024 -0400 init prometheus diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..3572a9e --- /dev/null +++ b/Jenkinsfile @@ -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' + } + } + } + } + + } +} + diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b31ef4e --- /dev/null +++ b/docker-compose.yml @@ -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 diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml new file mode 100644 index 0000000..f48194d --- /dev/null +++ b/prometheus/prometheus.yml @@ -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