about summary refs log tree commit diff
path: root/streaming
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2023-02-09 11:24:16 +0100
committerGitHub <noreply@github.com>2023-02-09 11:24:16 +0100
commitc5a4d8c82ddd5265abc830959a58cdaf1f061a43 (patch)
treecad87969af769cbb73162243e503110afc2947ec /streaming
parent4cb76475167750ef03b747aded962db7f1702f88 (diff)
Add information about database pool to metrics endpoint in streaming API (#23469)
Diffstat (limited to 'streaming')
-rw-r--r--streaming/index.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/streaming/index.js b/streaming/index.js
index 1fbbdea3b..a8708ec78 100644
--- a/streaming/index.js
+++ b/streaming/index.js
@@ -856,6 +856,15 @@ const startWorker = async (workerId) => {
     res.write('# TYPE connected_channels gauge\n');
     res.write('# HELP connected_channels The number of Redis channels the streaming server is subscribed to\n');
     res.write(`connected_channels ${Object.keys(subs).length}.0\n`);
+    res.write('# TYPE pg.pool.total_connections gauge \n');
+    res.write('# HELP pg.pool.total_connections The total number of clients existing within the pool\n');
+    res.write(`pg.pool.total_connections ${pgPool.totalCount}.0\n`);
+    res.write('# TYPE pg.pool.idle_connections gauge \n');
+    res.write('# HELP pg.pool.idle_connections The number of clients which are not checked out but are currently idle in the pool\n');
+    res.write(`pg.pool.idle_connections ${pgPool.idleCount}.0\n`);
+    res.write('# TYPE pg.pool.waiting_queries gauge \n');
+    res.write('# HELP pg.pool.waiting_queries The number of queued requests waiting on a client when all clients are checked out\n');
+    res.write(`pg.pool.waiting_queries ${pgPool.waitingCount}.0\n`);
     res.write('# EOF\n');
     res.end();
   }));