From 545d3c5a93216067b5df4185c2a997904e1817b0 Mon Sep 17 00:00:00 2001 From: Ever <439674061@qq.com> Date: Wed, 31 Jul 2024 00:21:16 +0800 Subject: [PATCH] chore: Add processId field for metrics of threads/db-pool-stat/health (#6797) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 老潮 Co-authored-by: takatost Co-authored-by: takatost --- api/app.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/app.py b/api/app.py index 2c484ace85..50441cb81d 100644 --- a/api/app.py +++ b/api/app.py @@ -261,6 +261,7 @@ def after_request(response): @app.route('/health') def health(): return Response(json.dumps({ + 'pid': os.getpid(), 'status': 'ok', 'version': app.config['CURRENT_VERSION'] }), status=200, content_type="application/json") @@ -284,6 +285,7 @@ def threads(): }) return { + 'pid': os.getpid(), 'thread_num': num_threads, 'threads': thread_list } @@ -293,6 +295,7 @@ def threads(): def pool_stat(): engine = db.engine return { + 'pid': os.getpid(), 'pool_size': engine.pool.size(), 'checked_in_connections': engine.pool.checkedin(), 'checked_out_connections': engine.pool.checkedout(),