Search in sources :

Example 1 with PrometheusBundle

use of org.dhatim.dropwizard.prometheus.PrometheusBundle in project polaris by ractf.

the class NodeMain method initialize.

@Override
public void initialize(final Bootstrap<NodeConfiguration> bootstrap) {
    bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
    bootstrap.addBundle(new ConsulBundle<>(getName()) {

        @Override
        public ConsulFactory getConsulFactory(final NodeConfiguration configuration) {
            return configuration.getConsulFactory();
        }
    });
    bootstrap.addBundle(GuiceBundle.builder().modules(new NodeModule()).enableAutoConfig("uk.co.ractf.polaris.consul", "uk.co.ractf.polaris.node.metrics", "uk.co.ractf.polaris.node.runner", "uk.co.ractf.polaris.node.resources", "uk.co.ractf.polaris.node.service").build());
    bootstrap.addBundle(new PrometheusBundle());
}
Also used : SubstitutingSourceProvider(io.dropwizard.configuration.SubstitutingSourceProvider) EnvironmentVariableSubstitutor(io.dropwizard.configuration.EnvironmentVariableSubstitutor) PrometheusBundle(org.dhatim.dropwizard.prometheus.PrometheusBundle) ConsulFactory(com.smoketurner.dropwizard.consul.ConsulFactory)

Example 2 with PrometheusBundle

use of org.dhatim.dropwizard.prometheus.PrometheusBundle in project polaris by ractf.

the class ControllerMain method initialize.

@Override
public void initialize(final Bootstrap<ControllerConfiguration> bootstrap) {
    bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
    bootstrap.addBundle(new ConsulBundle<>(getName()) {

        @Override
        public ConsulFactory getConsulFactory(final ControllerConfiguration configuration) {
            return configuration.getConsulFactory();
        }
    });
    bootstrap.addBundle(GuiceBundle.builder().modules(new ControllerModule()).enableAutoConfig("uk.co.ractf.polaris.consul", "uk.co.ractf.polaris.host.healthchecks", "uk.co.ractf.polaris.controller.instanceallocation", "uk.co.ractf.polaris.controller.metrics", "uk.co.ractf.polaris.controller.replication", "uk.co.ractf.polaris.controller.resources", "uk.co.ractf.polaris.host.runner", "uk.co.ractf.polaris.controller.scheduler", "uk.co.ractf.polaris.security", "uk.co.ractf.polaris.util").build());
    bootstrap.addBundle(new PrometheusBundle());
}
Also used : SubstitutingSourceProvider(io.dropwizard.configuration.SubstitutingSourceProvider) EnvironmentVariableSubstitutor(io.dropwizard.configuration.EnvironmentVariableSubstitutor) PrometheusBundle(org.dhatim.dropwizard.prometheus.PrometheusBundle) ConsulFactory(com.smoketurner.dropwizard.consul.ConsulFactory)

Aggregations

ConsulFactory (com.smoketurner.dropwizard.consul.ConsulFactory)2 EnvironmentVariableSubstitutor (io.dropwizard.configuration.EnvironmentVariableSubstitutor)2 SubstitutingSourceProvider (io.dropwizard.configuration.SubstitutingSourceProvider)2 PrometheusBundle (org.dhatim.dropwizard.prometheus.PrometheusBundle)2