From c3fafd175d7835040c72865027039285c81d757b Mon Sep 17 00:00:00 2001 From: Sophia Chen Date: Mon, 16 Dec 2024 16:24:29 +1100 Subject: [PATCH 1/2] sch-UID2-4560 added gauge for vertx service instances --- src/main/java/com/uid2/operator/Main.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/uid2/operator/Main.java b/src/main/java/com/uid2/operator/Main.java index 6b88d715b..51c7bef6c 100644 --- a/src/main/java/com/uid2/operator/Main.java +++ b/src/main/java/com/uid2/operator/Main.java @@ -265,6 +265,7 @@ private ICloudStorage wrapCloudStorageForOptOut(ICloudStorage cloudStorage) { } private void run() throws Exception { + this.createServiceInstancesMetric(); Supplier operatorVerticleSupplier = () -> { UIDOperatorVerticle verticle = new UIDOperatorVerticle(config, this.clientSideTokenGenerate, siteProvider, clientKeyProvider, clientSideKeypairProvider, getKeyManager(), saltProvider, optOutStore, Clock.systemUTC(), _statsCollectorQueue, new SecureLinkValidatorService(this.serviceLinkProvider, this.serviceProvider), this.shutdownHandler::handleSaltRetrievalResponse); return verticle; @@ -467,6 +468,12 @@ public DistributionStatisticConfig configure(Meter.Id id, DistributionStatisticC .register(globalRegistry); } + private void createServiceInstancesMetric() { + Gauge.builder("uid2.operator.vertx_service_instances", () -> config.getInteger("service_instances")) + .description("gauge for number of request processing threads") + .register(Metrics.globalRegistry); + } + private Map.Entry createUidClients(Vertx vertx, String attestationUrl, String clientApiToken, Handler> responseWatcher) throws Exception { AttestationResponseHandler attestationResponseHandler = getAttestationTokenRetriever(vertx, attestationUrl, clientApiToken, responseWatcher); UidCoreClient coreClient = new UidCoreClient(clientApiToken, CloudUtils.defaultProxy, attestationResponseHandler); From a40e3821df227a28c04177fe1578a80f0eddd6d5 Mon Sep 17 00:00:00 2001 From: Sophia Chen Date: Wed, 18 Dec 2024 16:02:10 +1100 Subject: [PATCH 2/2] sch-UID2-4560-adding-gauge-for-number-of-request-processing-threads added gauge for event loop threads --- src/main/java/com/uid2/operator/Main.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/uid2/operator/Main.java b/src/main/java/com/uid2/operator/Main.java index 51c7bef6c..9ca0c27a7 100644 --- a/src/main/java/com/uid2/operator/Main.java +++ b/src/main/java/com/uid2/operator/Main.java @@ -265,7 +265,8 @@ private ICloudStorage wrapCloudStorageForOptOut(ICloudStorage cloudStorage) { } private void run() throws Exception { - this.createServiceInstancesMetric(); + this.createVertxInstancesMetric(); + this.createVertxEventLoopsMetric(); Supplier operatorVerticleSupplier = () -> { UIDOperatorVerticle verticle = new UIDOperatorVerticle(config, this.clientSideTokenGenerate, siteProvider, clientKeyProvider, clientSideKeypairProvider, getKeyManager(), saltProvider, optOutStore, Clock.systemUTC(), _statsCollectorQueue, new SecureLinkValidatorService(this.serviceLinkProvider, this.serviceProvider), this.shutdownHandler::handleSaltRetrievalResponse); return verticle; @@ -468,9 +469,15 @@ public DistributionStatisticConfig configure(Meter.Id id, DistributionStatisticC .register(globalRegistry); } - private void createServiceInstancesMetric() { + private void createVertxInstancesMetric() { Gauge.builder("uid2.operator.vertx_service_instances", () -> config.getInteger("service_instances")) - .description("gauge for number of request processing threads") + .description("gauge for number of vertx service instances requested") + .register(Metrics.globalRegistry); + } + + private void createVertxEventLoopsMetric() { + Gauge.builder("uid2.operator.vertx_event_loop_threads", () -> VertxOptions.DEFAULT_EVENT_LOOP_POOL_SIZE) + .description("gauge for number of vertx event loop threads") .register(Metrics.globalRegistry); }