Skip to content

Commit

Permalink
sch-UID2-4560 added gauge for vertx service instances
Browse files Browse the repository at this point in the history
  • Loading branch information
sophia-chen-ttd committed Dec 16, 2024
1 parent b792232 commit c3fafd1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/com/uid2/operator/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ private ICloudStorage wrapCloudStorageForOptOut(ICloudStorage cloudStorage) {
}

private void run() throws Exception {
this.createServiceInstancesMetric();
Supplier<Verticle> 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;
Expand Down Expand Up @@ -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<UidCoreClient, UidOptOutClient> createUidClients(Vertx vertx, String attestationUrl, String clientApiToken, Handler<Pair<AttestationResponseCode, String>> responseWatcher) throws Exception {
AttestationResponseHandler attestationResponseHandler = getAttestationTokenRetriever(vertx, attestationUrl, clientApiToken, responseWatcher);
UidCoreClient coreClient = new UidCoreClient(clientApiToken, CloudUtils.defaultProxy, attestationResponseHandler);
Expand Down

0 comments on commit c3fafd1

Please sign in to comment.