Skip to content

Commit

Permalink
api: Add a unique URL for healthchecks
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Doan <[email protected]>
  • Loading branch information
doanac committed Jul 10, 2023
1 parent 495e508 commit 67645b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions jobserv/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,7 @@ def unexpected_error(e):
return jsendify(data, 500)

app.register_blueprint(bp)

@app.route("/healthz")
def _healthz():
return ""
2 changes: 1 addition & 1 deletion jobserv/flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def create_app(settings_object="jobserv.settings"):
# this gets called a couple times.
if not getattr(create_app, "__logging_hack_initialized", None):
json_logging.init_flask(enable_json=True)
json_logging.init_request_instrument(app)
json_logging.init_request_instrument(app, exclude_url_patterns=["/healthz"])
json_logging.config_root_logger()
create_app.__logging_hack_initialized = True

Expand Down

0 comments on commit 67645b2

Please sign in to comment.