summaryrefslogtreecommitdiff
path: root/tests/fixtures/zuul-prometheus.conf
diff options
context:
space:
mode:
authorJames E. Blair <jim@acmegating.com>2021-12-08 15:42:39 -0800
committerJames E. Blair <jim@acmegating.com>2021-12-09 07:37:29 -0800
commit704fef6cb9d5649b2c66d414fa576e75c9a9e3d5 (patch)
treeb4a5fef3e34f59594a2ce02b1c3b67fa8d19da6f /tests/fixtures/zuul-prometheus.conf
parent9dba1af7a93cfdcd20590f360f2c1de634a831d1 (diff)
downloadzuul-704fef6cb9d5649b2c66d414fa576e75c9a9e3d5.tar.gz
Add readiness/liveness probes to prometheus server
To facilitate automation of rolling restarts, configure the prometheus server to answer readiness and liveness probes. We are 'live' if the process is running, and we are 'ready' if our component state is either running or paused (not initializing or stopped). The prometheus_client library doesn't support this directly, so we need to handle this ourselves. We could create yet another HTTP server that each component would need to start, or we could take advantage of the fact that the prometheus_client is a standard WSGI service and just wrap it in our own WSGI service that adds the extra endpoints needed. Since that is far simpler and less resounce intensive, that is what this change does. The prometheus_client will actually return the metrics on any path given to it. In order to reduce the chances of an operator configuring a liveness probe with a typo (eg '/healthy/ready') and getting the metrics page served with a 200 response, we restrict the metrics to only the '/metrics' URI which is what we specified in our documentation, and also '/' which is very likely accidentally used by users. Change-Id: I154ca4896b69fd52eda655209480a75c8d7dbac3
Diffstat (limited to 'tests/fixtures/zuul-prometheus.conf')
-rw-r--r--tests/fixtures/zuul-prometheus.conf41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/fixtures/zuul-prometheus.conf b/tests/fixtures/zuul-prometheus.conf
new file mode 100644
index 000000000..f0399f282
--- /dev/null
+++ b/tests/fixtures/zuul-prometheus.conf
@@ -0,0 +1,41 @@
+[gearman]
+server=127.0.0.1
+
+[statsd]
+# note, use 127.0.0.1 rather than localhost to avoid getting ipv6
+# see: https://github.com/jsocol/pystatsd/issues/61
+server=127.0.0.1
+
+[scheduler]
+tenant_config=main.yaml
+relative_priority=true
+prometheus_port=0
+
+[merger]
+git_dir=/tmp/zuul-test/merger-git
+git_user_email=zuul@example.com
+git_user_name=zuul
+
+[executor]
+git_dir=/tmp/zuul-test/executor-git
+load_multiplier=100
+
+[connection gerrit]
+driver=gerrit
+server=review.example.com
+user=jenkins
+sshkey=fake_id_rsa_path
+
+[connection smtp]
+driver=smtp
+server=localhost
+port=25
+default_from=zuul@example.com
+default_to=you@example.com
+
+[database]
+dburi=$MYSQL_FIXTURE_DBURI$
+
+[web]
+static_cache_expiry=1200
+root=https://zuul.example.com/