|
32 | 32 | import io.micrometer.core.instrument.config.MeterFilter; |
33 | 33 | import io.micrometer.prometheus.PrometheusMeterRegistry; |
34 | 34 | import io.micrometer.prometheus.PrometheusRenameFilter; |
| 35 | +import io.vertx.core.DeploymentOptions; |
35 | 36 | import io.vertx.core.Vertx; |
36 | 37 | import io.vertx.core.VertxOptions; |
37 | 38 | import io.vertx.core.http.HttpServerOptions; |
@@ -159,17 +160,19 @@ public static void main(String[] args) { |
159 | 160 | ); |
160 | 161 |
|
161 | 162 | JwtService jwtService = new JwtService(config); |
162 | | - createServiceInstancesMetric(); |
163 | 163 | coreVerticle = new CoreVerticle(cloudStorage, operatorKeyProvider, attestationService, attestationTokenService, enclaveIdProvider, operatorJWTTokenProvider, jwtService, cloudEncryptionKeyProvider); |
164 | 164 | } catch (Exception e) { |
165 | 165 | System.out.println("failed to initialize core verticle: " + e.getMessage()); |
166 | 166 | System.exit(-1); |
167 | 167 | } |
168 | 168 |
|
| 169 | + createVertxInstancesMetric(); |
| 170 | + createVertxEventLoopsMetric(); |
| 171 | + |
169 | 172 | vertx.deployVerticle(enclaveRotatingVerticle); |
170 | 173 | vertx.deployVerticle(operatorRotatingVerticle); |
171 | 174 | vertx.deployVerticle(cloudEncryptionKeyRotatingVerticle); |
172 | | - vertx.deployVerticle(coreVerticle); |
| 175 | + vertx.deployVerticle(coreVerticle, new DeploymentOptions().setInstances(vertxServiceInstances)); |
173 | 176 | }); |
174 | 177 | } |
175 | 178 |
|
@@ -212,12 +215,19 @@ private static void setupMetrics(MicrometerMetricsOptions metricOptions) { |
212 | 215 | .register(Metrics.globalRegistry); |
213 | 216 | } |
214 | 217 |
|
215 | | - private static void createServiceInstancesMetric() { |
| 218 | + private static void createVertxInstancesMetric() { |
216 | 219 | Gauge.builder("uid2.core.vertx_service_instances", () -> vertxServiceInstances) |
217 | | - .description("gauge for number of request processing threads") |
| 220 | + .description("gauge for number of vertx service instances requested") |
218 | 221 | .register(Metrics.globalRegistry); |
219 | 222 | } |
220 | 223 |
|
| 224 | + private static void createVertxEventLoopsMetric() { |
| 225 | + Gauge.builder("uid2.core.vertx_event_loop_threads", () -> VertxOptions.DEFAULT_EVENT_LOOP_POOL_SIZE) |
| 226 | + .description("gauge for number of vertx event loop threads") |
| 227 | + .register(Metrics.globalRegistry); |
| 228 | + } |
| 229 | + |
| 230 | + |
221 | 231 | /* |
222 | 232 | private static CommandLine parseArgs(String[] args) { |
223 | 233 | final CLI cli = CLI.create("uid2-core") |
|
0 commit comments