Skip to content

Commit

Permalink
sch-UID2-4560 added gauge for number of service instances
Browse files Browse the repository at this point in the history
  • Loading branch information
sophia-chen-ttd committed Dec 17, 2024
1 parent 7a33db7 commit 9aca44d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/com/uid2/core/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@

public class Main {

private static final int vertxServiceInstances = 1;

public static void main(String[] args) {
final String vertxConfigPath = System.getProperty(Const.Config.VERTX_CONFIG_PATH_PROP);
if (vertxConfigPath != null) {
Expand Down Expand Up @@ -157,7 +159,7 @@ public static void main(String[] args) {
);

JwtService jwtService = new JwtService(config);

createServiceInstancesMetric();
coreVerticle = new CoreVerticle(cloudStorage, operatorKeyProvider, attestationService, attestationTokenService, enclaveIdProvider, operatorJWTTokenProvider, jwtService, cloudEncryptionKeyProvider);
} catch (Exception e) {
System.out.println("failed to initialize core verticle: " + e.getMessage());
Expand Down Expand Up @@ -210,6 +212,12 @@ private static void setupMetrics(MicrometerMetricsOptions metricOptions) {
.register(Metrics.globalRegistry);
}

private static void createServiceInstancesMetric() {
Gauge.builder("uid2.core.vertx_service_instances", () -> vertxServiceInstances)
.description("gauge for number of request processing threads")
.register(Metrics.globalRegistry);
}

/*
private static CommandLine parseArgs(String[] args) {
final CLI cli = CLI.create("uid2-core")
Expand Down

0 comments on commit 9aca44d

Please sign in to comment.