Skip to content
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.

Export metrics #189

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
21 changes: 21 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,24 @@ repoURL=<yours_repository>
branch=<yours_branch>
sha1=<your_last_commit_id_at_branch>
version=<the_James_version_of_this_branch>

=== Tools

==== Prometheus
aduprat marked this conversation as resolved.
Show resolved Hide resolved

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).
aduprat marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions plugins.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
25 changes: 25 additions & 0 deletions prometheus.yml
Original file line number Diff line number Diff line change
@@ -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']