From 30eb238ddb4d91b5321378416e693595d34a0a70 Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Thu, 9 Apr 2026 20:00:23 +1200 Subject: [PATCH] Reset the metrics after initialisation of the pool This is desired in the K8s case where we likely want to use initialConnection to oversize the connection pool on pod startup, with it shrinking back down over time. --- .../src/main/java/io/ebean/datasource/pool/ConnectionPool.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ebean-datasource/src/main/java/io/ebean/datasource/pool/ConnectionPool.java b/ebean-datasource/src/main/java/io/ebean/datasource/pool/ConnectionPool.java index 47b32cf..48f53da 100644 --- a/ebean-datasource/src/main/java/io/ebean/datasource/pool/ConnectionPool.java +++ b/ebean-datasource/src/main/java/io/ebean/datasource/pool/ConnectionPool.java @@ -155,6 +155,8 @@ private void init() { initialiseDatabase(); } initialiseConnections(); + // reset the metrics + status(true); } catch (SQLException e) { throw new DataSourceInitialiseException("Error initialising DataSource with user: " + user + " error:" + e.getMessage(), e); }