use of io.vertx.ext.dropwizard.DropwizardMetricsOptions in project prebid-server-java by prebid.
the class VertxConfiguration method vertx.
@Bean
Vertx vertx(@Value("${vertx.worker-pool-size}") int workerPoolSize, @Value("${vertx.enable-per-client-endpoint-metrics}") boolean enablePerClientEndpointMetrics) {
final DropwizardMetricsOptions metricsOptions = new DropwizardMetricsOptions().setEnabled(true).setRegistryName(MetricsConfiguration.METRIC_REGISTRY_NAME);
if (enablePerClientEndpointMetrics) {
metricsOptions.addMonitoredHttpClientEndpoint(new Match().setValue(".*").setType(MatchType.REGEX));
}
final VertxOptions vertxOptions = new VertxOptions().setWorkerPoolSize(workerPoolSize).setMetricsOptions(metricsOptions);
return Vertx.vertx(vertxOptions);
}
use of io.vertx.ext.dropwizard.DropwizardMetricsOptions in project okapi by folio-org.
the class MetricsTest method setUp.
@Before
public void setUp(TestContext context) {
String graphiteHost = System.getProperty("graphiteHost");
final String registryName = "okapi";
MetricRegistry registry = SharedMetricRegistries.getOrCreate(registryName);
// Note the setEnabled (true or false)
DropwizardMetricsOptions metricsOpt = new DropwizardMetricsOptions().setEnabled(false).setRegistryName(registryName);
vertx = Vertx.vertx(new VertxOptions().setMetricsOptions(metricsOpt));
reporter1 = ConsoleReporter.forRegistry(registry).build();
reporter1.start(1, TimeUnit.SECONDS);
if (graphiteHost != null) {
Graphite graphite = new Graphite(new InetSocketAddress(graphiteHost, 2003));
reporter2 = GraphiteReporter.forRegistry(registry).prefixedWith("okapiserver").build(graphite);
reporter2.start(1, TimeUnit.MILLISECONDS);
}
DeploymentOptions opt = new DeploymentOptions().setConfig(new JsonObject().put("port", Integer.toString(port)));
vertx.deployVerticle(MainVerticle.class.getName(), opt, context.asyncAssertSuccess());
httpClient = vertx.createHttpClient();
}
use of io.vertx.ext.dropwizard.DropwizardMetricsOptions in project raml-module-builder by folio-org.
the class RestLauncher method beforeStartingVertx.
@Override
public void beforeStartingVertx(VertxOptions options) {
// TODO Auto-generated method stub
super.beforeStartingVertx(options);
System.out.println("starting rest verticle service..........");
options.setBlockedThreadCheckInterval(1500000);
options.setWarningExceptionTime(1500000);
options.setMetricsOptions(new DropwizardMetricsOptions().setEnabled(true).addMonitoredHttpServerUri(new Match().setValue("/.*").setType(MatchType.REGEX)));
}
use of io.vertx.ext.dropwizard.DropwizardMetricsOptions in project okapi by folio-org.
the class DropwizardHelper method config.
public static void config(String graphiteHost, int port, TimeUnit tu, int period, VertxOptions vopt, String hostName) {
final String registryName = "okapi";
MetricRegistry registry = SharedMetricRegistries.getOrCreate(registryName);
DropwizardMetricsOptions metricsOpt = new DropwizardMetricsOptions();
metricsOpt.setEnabled(true).setRegistryName(registryName);
vopt.setMetricsOptions(metricsOpt);
Graphite graphite = new Graphite(new InetSocketAddress(graphiteHost, port));
final String prefix = "folio.okapi." + hostName;
GraphiteReporter reporter = GraphiteReporter.forRegistry(registry).prefixedWith(prefix).build(graphite);
reporter.start(period, tu);
logger.info("Metrics remote:" + graphiteHost + ":" + port + " this:" + prefix);
}
use of io.vertx.ext.dropwizard.DropwizardMetricsOptions in project ksql by confluentinc.
the class KsqlRestApplication method setUpHttpMetrics.
private static DropwizardMetricsOptions setUpHttpMetrics(final KsqlConfig ksqlConfig) {
final String serviceId = ksqlConfig.getString(KsqlConfig.KSQL_SERVICE_ID_CONFIG);
final DropwizardMetricsOptions metricsOptions = new DropwizardMetricsOptions().setJmxEnabled(true).setBaseName("_confluent-ksql-" + serviceId).setJmxDomain("io.confluent.ksql.metrics");
final List<Match> matches = MonitoredEndpoints.getMonitoredEndpoints();
for (Match match : matches) {
metricsOptions.addMonitoredHttpServerUri(match);
}
return metricsOptions;
}
Aggregations