Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sch-UID2-4560 add gauge for number of processing request threads #1215

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 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,8 @@ private ICloudStorage wrapCloudStorageForOptOut(ICloudStorage cloudStorage) {
}

private void run() throws Exception {
this.createVertxInstancesMetric();
this.createVertxEventLoopsMetric();
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 +469,18 @@ public DistributionStatisticConfig configure(Meter.Id id, DistributionStatisticC
.register(globalRegistry);
}

private void createVertxInstancesMetric() {
Gauge.builder("uid2.operator.vertx_service_instances", () -> config.getInteger("service_instances"))
.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);
}

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
Loading