File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ import { Server } from "./server";
57
57
import { log , LogrusLogLevel } from "@gitpod/gitpod-protocol/lib/util/logging" ;
58
58
import { TracingManager } from "@gitpod/gitpod-protocol/lib/util/tracing" ;
59
59
import { TypeORM } from "@gitpod/gitpod-db/lib" ;
60
- import { dbConnectionsFree , dbConnectionsTotal } from "./prometheus-metrics" ;
60
+ import { dbConnectionsEnqueued , dbConnectionsFree , dbConnectionsTotal } from "./prometheus-metrics" ;
61
61
if ( process . env . NODE_ENV === "development" ) {
62
62
require ( "longjohn" ) ;
63
63
}
@@ -85,6 +85,10 @@ export async function start(container: Container) {
85
85
const activeConnections = pool . _allConnections . length ;
86
86
const freeConnections = pool . _freeConnections . length ;
87
87
88
+ pool . on ( "enqueue" , function ( ) {
89
+ dbConnectionsEnqueued . inc ( ) ;
90
+ } ) ;
91
+
88
92
dbConnectionsTotal . set ( activeConnections ) ;
89
93
dbConnectionsFree . set ( freeConnections ) ;
90
94
} catch ( error ) {
Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ export const dbConnectionsFree = new prometheusClient.Gauge({
47
47
help : "Number of free connections in TypeORM pool" ,
48
48
} ) ;
49
49
50
+ export const dbConnectionsEnqueued = new prometheusClient . Counter ( {
51
+ name : "gitpod_typeorm_enqueued_connections" ,
52
+ help : "Number of times requests put on the queue, because the pool was maxed out." ,
53
+ } ) ;
54
+
50
55
const loginCompletedTotal = new prometheusClient . Counter ( {
51
56
name : "gitpod_login_completed_total" ,
52
57
help : "Total number of logins completed into gitpod, by status" ,
You can’t perform that action at this time.
0 commit comments