Merge ~cjwatson/launchpad:charm-appserver-simplify-status-check into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: d569160d39f912ce95ed1702574c3bae05a763e0
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:charm-appserver-simplify-status-check
Merge into: launchpad:master
Diff against target: 33 lines (+2/-6)
1 file modified
charm/launchpad-appserver/reactive/launchpad-appserver.py (+2/-6)
Reviewer Review Type Date Requested Status
Guruprasad Approve
Review via email: mp+444939@code.launchpad.net

Commit message

charm/launchpad-appserver: Use /_status/check as health check

Description of the change

This is more lightweight than checking the front page, but it still checks that the appserver has a database connection.

To post a comment you must log in.
Revision history for this message
Guruprasad (lgp171188) wrote :

LGTM 👍

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charm/launchpad-appserver/reactive/launchpad-appserver.py b/charm/launchpad-appserver/reactive/launchpad-appserver.py
2index ad4b439..6ba559f 100644
3--- a/charm/launchpad-appserver/reactive/launchpad-appserver.py
4+++ b/charm/launchpad-appserver/reactive/launchpad-appserver.py
5@@ -1,7 +1,6 @@
6 # Copyright 2022 Canonical Ltd. This software is licensed under the
7 # GNU Affero General Public License version 3 (see the file LICENSE).
8
9-import shlex
10 import subprocess
11 from multiprocessing import cpu_count
12
13@@ -182,9 +181,6 @@ def memcache_relation_changed(memcache):
14 def nrpe_available():
15 nrpe = endpoint_from_flag("nrpe-external-master.available")
16 config = hookenv.config()
17- healthy_regex = (
18- r"(\/\+icing\/rev[0-9a-f]+\/).*(Is your project registered yet\?)"
19- )
20 nrpe.add_check(
21 [
22 "/usr/lib/nagios/plugins/check_http",
23@@ -192,8 +188,8 @@ def nrpe_available():
24 "localhost",
25 "-p",
26 str(config["port_main"]),
27- "-l",
28- "--regex=%s" % shlex.quote(healthy_regex),
29+ "-u",
30+ "/_status/check",
31 ],
32 name="check_launchpad_appserver",
33 description="Launchpad appserver",

Subscribers

People subscribed via source and target branches

to status/vote changes: