|
13 | 13 | */ |
14 | 14 | package io.trino.gateway.ha.module; |
15 | 15 |
|
| 16 | +import com.google.common.collect.ImmutableList; |
16 | 17 | import com.google.inject.AbstractModule; |
17 | 18 | import com.google.inject.Provides; |
18 | 19 | import com.google.inject.Scopes; |
|
37 | 38 | import io.trino.gateway.ha.config.DataStoreConfiguration; |
38 | 39 | import io.trino.gateway.ha.config.GatewayCookieConfigurationPropertiesProvider; |
39 | 40 | import io.trino.gateway.ha.config.HaGatewayConfiguration; |
| 41 | +import io.trino.gateway.ha.config.MonitorConfiguration; |
40 | 42 | import io.trino.gateway.ha.config.OAuth2GatewayCookieConfigurationPropertiesProvider; |
41 | 43 | import io.trino.gateway.ha.config.RoutingRulesConfiguration; |
42 | 44 | import io.trino.gateway.ha.config.RulesExternalConfiguration; |
|
54 | 56 | import io.trino.gateway.ha.router.QueryHistoryManager; |
55 | 57 | import io.trino.gateway.ha.router.ResourceGroupsManager; |
56 | 58 | import io.trino.gateway.ha.router.RoutingGroupSelector; |
| 59 | +import io.trino.gateway.ha.router.RoutingManager; |
57 | 60 | import io.trino.gateway.ha.router.ValkeyDistributedCache; |
58 | 61 | import io.trino.gateway.ha.security.AuthorizationManager; |
59 | 62 | import io.trino.gateway.ha.security.LbAuthorizer; |
|
68 | 71 | import org.jdbi.v3.core.Jdbi; |
69 | 72 | import org.jdbi.v3.sqlobject.SqlObjectPlugin; |
70 | 73 |
|
| 74 | +import java.util.List; |
| 75 | + |
71 | 76 | import static com.google.inject.multibindings.Multibinder.newSetBinder; |
72 | 77 | import static io.airlift.jaxrs.JaxrsBinder.jaxrsBinder; |
73 | 78 | import static io.trino.gateway.ha.config.ClusterStatsMonitorType.INFO_API; |
@@ -202,6 +207,25 @@ public static ClusterStatsMonitor getClusterStatsMonitor(@ForMonitor HttpClient |
202 | 207 | }; |
203 | 208 | } |
204 | 209 |
|
| 210 | + @Provides |
| 211 | + @Singleton |
| 212 | + public List<TrinoClusterStatsObserver> getClusterStatsObservers( |
| 213 | + RoutingManager mgr, |
| 214 | + BackendStateManager backendStateManager) |
| 215 | + { |
| 216 | + return ImmutableList.<TrinoClusterStatsObserver>builder() |
| 217 | + .add(new HealthCheckObserver(mgr)) |
| 218 | + .add(new ClusterStatsObserver(backendStateManager)) |
| 219 | + .build(); |
| 220 | + } |
| 221 | + |
| 222 | + @Provides |
| 223 | + @Singleton |
| 224 | + public MonitorConfiguration getMonitorConfiguration() |
| 225 | + { |
| 226 | + return configuration.getMonitor(); |
| 227 | + } |
| 228 | + |
205 | 229 | @Provides |
206 | 230 | @Singleton |
207 | 231 | public ValkeyConfiguration getValkeyConfiguration() |
|
0 commit comments