diff --git a/Dockerfile b/Dockerfile index 5ac34b7..ba7e7a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,12 +6,11 @@ RUN echo "deb http://archive.debian.org/debian jessie main" > /etc/apt/sources.l && rm /etc/apt/sources.list.d/jessie-backports.list RUN apt-get update \ - && apt-get install -y apt-transport-https ca-certificates \ - && apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D \ - && echo deb https://apt.dockerproject.org/repo debian-jessie main >> /etc/apt/sources.list.d/docker.list \ + && apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common \ + && curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \ + && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \ && apt-get update \ - && apt-get install -y docker-engine \ - && rm -rf /var/lib/apt/lists/* + && apt-get install -y docker-ce USER jenkins diff --git a/README.adoc b/README.adoc index e1f803d..05ad2d8 100644 --- a/README.adoc +++ b/README.adoc @@ -141,3 +141,24 @@ repoURL= branch= sha1= version= + +=== Tools + +==== Prometheus + +Prometheus plugin is automatically installed when starting Jenkins from the Dockerfile. +This plugin is exporting lot of metrics from Jenkins, in order to read those metrics, you can start Prometheus in docker: + +---- +$ docker run -d -p 9090:9090 -v $PWD/prometheus.yml:/etc/prometheus/prometheus.yml --name prometheus prom/prometheus +---- + +==== Grafana + +If you want to have an UI based on the metrics contained by Prometheus, you can install Grafana in docker: + +---- +$ docker run -d -p 3000:3000 --name grafana grafana/grafana +---- + +then, you will have to create a Prometheus database from default pattern and import some board (for example: 9964). diff --git a/plugins.txt b/plugins.txt index 84f0b6c..3ab04f7 100644 --- a/plugins.txt +++ b/plugins.txt @@ -10,8 +10,10 @@ job-dsl:1.34 mapdb-api:1.0.6.0 mask-passwords:2.8 maven-plugin:2.7.1 +metrics:3.1.2 parameterized-trigger:2.27 plain-credentials:1.1 +prometheus:2.0.0 scm-api:0.2 ssh-agent:1.7 subversion:2.5.1 diff --git a/prometheus.yml b/prometheus.yml new file mode 100644 index 0000000..af42f92 --- /dev/null +++ b/prometheus.yml @@ -0,0 +1,25 @@ +# my global config +global: + scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. + evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. + # scrape_timeout is set to the global default (10s). + +# Alertmanager configuration +alerting: + alertmanagers: + - static_configs: + - targets: + # - alertmanager:9093 + +# Load rules once and periodically evaluate them according to the global 'evaluation_interval'. +rule_files: + # - "first_rules.yml" + # - "second_rules.yml" + +# A scrape configuration containing exactly one endpoint to scrape: +# Here it's Prometheus itself. +scrape_configs: + - job_name: 'jenkins' + metrics_path: /prometheus + static_configs: + - targets: ['172.17.0.1:8080']