use of io.micrometer.core.instrument.logging.LoggingMeterRegistry in project java-operator-sdk by java-operator-sdk.
the class MySQLSchemaOperator method main.
public static void main(String[] args) throws IOException {
log.info("MySQL Schema Operator starting");
Config config = new ConfigBuilder().withNamespace(null).build();
KubernetesClient client = new DefaultKubernetesClient(config);
Operator operator = new Operator(client, new ConfigurationServiceOverrider(DefaultConfigurationService.instance()).withMetrics(new MicrometerMetrics(new LoggingMeterRegistry())).build());
operator.register(new MySQLSchemaReconciler(client, MySQLDbConfig.loadFromEnvironmentVars()));
operator.installShutdownHook();
operator.start();
new FtBasic(new TkFork(new FkRegex("/health", "ALL GOOD!")), 8080).start(Exit.NEVER);
}
use of io.micrometer.core.instrument.logging.LoggingMeterRegistry in project micrometer by micrometer-metrics.
the class Jersey3Main method main.
public static void main(String[] args) throws IOException {
MeterRegistry registry = new LoggingMeterRegistry(new LoggingRegistryConfig() {
@Override
public String get(String key) {
return null;
}
@Override
public Duration step() {
return Duration.ofSeconds(10);
}
}, Clock.SYSTEM);
HttpServer server = HttpServer.create(new InetSocketAddress(8080), 0);
Runtime.getRuntime().addShutdownHook(new Thread(() -> server.stop(0)));
Application application = new ResourceConfig(HelloWorldResource.class).register(new MetricsApplicationEventListener(registry, new DefaultJerseyTagsProvider(), "http.server.requests", true));
server.createContext("/", RuntimeDelegate.getInstance().createEndpoint(application, HttpHandler.class));
server.start();
}
use of io.micrometer.core.instrument.logging.LoggingMeterRegistry in project micrometer by micrometer-metrics.
the class HazelcastCacheSample method main.
public static void main(String[] args) throws Exception {
MeterRegistry registry = loggingMeterRegistry();
IMap<String, Integer> hazelcastCache = Hazelcast.newHazelcastInstance().getMap("hazelcast.cache");
HazelcastCacheMetrics.monitor(registry, hazelcastCache);
for (int i = 0; i < 100; i++) {
hazelcastCache.put("key" + i, i);
Thread.sleep(1000);
}
}
use of io.micrometer.core.instrument.logging.LoggingMeterRegistry in project micrometer by micrometer-metrics.
the class HazelcastCacheSample method main.
public static void main(String[] args) throws Exception {
MeterRegistry registry = loggingMeterRegistry();
IMap<String, Integer> hazelcastCache = Hazelcast.newHazelcastInstance().getMap("hazelcast.cache");
HazelcastCacheMetrics.monitor(registry, hazelcastCache);
for (int i = 0; i < 100; i++) {
hazelcastCache.put("key" + i, i);
Thread.sleep(1000);
}
}
Aggregations