-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Open
Description
Check Ahead
-
I have searched the issues of this repository and believe that this is not a duplicate.
-
I am willing to try to implement this feature myself.
Why you need it?
Seata currently lacks a REST-based controller and service layer for connection-pool monitoring. Without these, the Console UI cannot:
- The Console UI cannot fetch live pool metrics (active, idle, total connections).
- There is no way to view or update pool configuration (maxPoolSize, minIdle, timeouts) at runtime.
- Time-series data (e.g. pool size trends, SQL execution histograms) cannot be streamed to the Console.
This makes it impossible to monitor and dynamically tune connection pools from the Seata Console, limiting operational visibility and runtime adjustments.
How it could be?
-
ConnectionPoolController (
/api/v1/connection-pool)- GET /health →
{ status: "UP" | "DOWN", registeredServices: <int>, timestamp: <ms> } - GET /services →
{ services: [String], count: <int> } - GET /metrics →
List<ConnectionPoolMetrics>(all services) - GET /metrics/{serviceName}?includeTransactionChart={bool}&includeSqlChart={bool} → detailed JSON with common metrics + optional histograms & slow-SQL list
- GET /config →
List<ConnectionPoolConfig> - GET /config/{serviceName} → single
ConnectionPoolConfig - PUT /config/{serviceName} → accept
ConnectionPoolConfigJSON to update settings - GET /info/{serviceName} → combined
{ serviceName, metrics, config, timestamp }
- GET /health →
-
ConnectionPoolService
getMetrics(String serviceName): ConnectionPoolMetricsgetAllMetrics(): List<ConnectionPoolMetrics>getConfig(String serviceName): ConnectionPoolConfigupdateConfig(String serviceName, ConnectionPoolConfig cfg)getAllServiceNames(): List<String>isServiceRegistered(String serviceName): booleangetRegisteredServiceCount(): int
-
ConnectionPoolChartService
isDruidMetrics(ConnectionPoolMetrics m): booleangenerateTransactionHistogram(long[] ranges, long[] values): Map<String,Long>generateSqlExecutionHistogram(List<SqlExecutionEntry> records): Map<String,Integer>
These endpoints and services will allow the Console to poll metrics, render dynamic charts, and push configuration updates back to the connected microservices.
Other related information
- Builds on the common-module and rm-datasource models from [PR feature: add SQL monitoring and connection pool abstraction with implementation and tests #7556 ]:
ConnectionPoolConfig,ConnectionPoolMetrics,PoolManagerinterfacesSqlExecutionEntry,SqlMonitorfor SQL event collection- Use reflection to implement the connection-pool
Metadata
Metadata
Assignees
Labels
No labels