Search in sources :

Example 11 with MetricsSupport

use of io.helidon.metrics.MetricsSupport in project helidon by oracle.

the class Se1Main method createRouting.

/**
 * Creates new {@link io.helidon.webserver.Routing}.
 *
 * @return routing configured with JSON support, a health check, and a service
 * @param config configuration of this server
 */
private static Routing createRouting(Config config) {
    MetricsSupport metrics = MetricsSupport.create();
    GreetService greetService = new GreetService(config);
    MockZipkinService zipkinService = new MockZipkinService(Set.of("helidon-webclient"));
    WebClientService webClientService = new WebClientService(config, zipkinService);
    HealthSupport health = HealthSupport.builder().addLiveness(// Adds a convenient set of checks
    HealthChecks.healthChecks()).addLiveness(() -> // a custom health check
    HealthCheckResponse.named("custom").up().withData("timestamp", System.currentTimeMillis()).build()).build();
    return Routing.builder().register("/static/path", StaticContentSupport.create(Paths.get("web"))).register("/static/classpath", StaticContentSupport.create("web")).register("/static/jar", StaticContentSupport.create("web-jar")).register(WebSecurity.create(config.get("security"))).register(// Health at "/health"
    health).register(// Metrics at "/metrics"
    metrics).register("/greet", greetService).register("/wc", webClientService).register("/zipkin", zipkinService).register("/ws", TyrusSupport.builder().register(ServerEndpointConfig.Builder.create(WebSocketEndpoint.class, "/messages").build()).build()).build();
}
Also used : HealthSupport(io.helidon.health.HealthSupport) MetricsSupport(io.helidon.metrics.MetricsSupport)

Example 12 with MetricsSupport

use of io.helidon.metrics.MetricsSupport in project helidon by oracle.

the class Main method createRouting.

/**
 * Creates new {@link Routing}.
 *
 * @return routing configured with JSON support, a health check, and a service
 * @param config configuration of this server
 */
private static Routing createRouting(Config config) {
    MetricsSupport metrics = MetricsSupport.create();
    GreetService greetService = new GreetService(config);
    HealthSupport health = HealthSupport.builder().addLiveness(// Adds a convenient set of checks
    HealthChecks.healthChecks()).build();
    // Note: Add the CORS routing *before* registering the GreetService routing.
    return Routing.builder().register(// Health at "/health"
    health).register(// Metrics at "/metrics"
    metrics).register("/greet", corsSupportForGreeting(config), greetService).build();
}
Also used : HealthSupport(io.helidon.health.HealthSupport) MetricsSupport(io.helidon.metrics.MetricsSupport)

Example 13 with MetricsSupport

use of io.helidon.metrics.MetricsSupport in project helidon by oracle.

the class Main method createRouting.

/**
 * Creates new {@link Routing}.
 *
 * @param config configuration of this server
 * @return routing configured with a health check, and a service
 */
private static Routing createRouting(Config config) {
    MetricsSupport metrics = MetricsSupport.create();
    EmployeeService employeeService = new EmployeeService(config);
    HealthSupport health = HealthSupport.builder().addLiveness(HealthChecks.healthChecks()).build();
    return Routing.builder().register("/public", StaticContentSupport.builder("public").welcomeFileName("index.html")).register(// Health at "/health"
    health).register(// Metrics at "/metrics"
    metrics).register("/employees", employeeService).build();
}
Also used : HealthSupport(io.helidon.health.HealthSupport) MetricsSupport(io.helidon.metrics.MetricsSupport)

Example 14 with MetricsSupport

use of io.helidon.metrics.MetricsSupport in project helidon by oracle.

the class Main method createRouting.

private static Routing createRouting(Config config, CoordinatorService coordinatorService) {
    MetricsSupport metrics = MetricsSupport.create();
    HealthSupport health = HealthSupport.builder().addLiveness(HealthChecks.healthChecks()).build();
    return Routing.builder().register(metrics).register(health).register(config.get("mp.lra.coordinator.context.path").asString().orElse("/lra-coordinator"), coordinatorService).build();
}
Also used : HealthSupport(io.helidon.health.HealthSupport) MetricsSupport(io.helidon.metrics.MetricsSupport)

Aggregations

MetricsSupport (io.helidon.metrics.MetricsSupport)14 HealthSupport (io.helidon.health.HealthSupport)10 MovieRepository (io.helidon.examples.integrations.neo4j.se.domain.MovieRepository)1 Neo4j (io.helidon.integrations.neo4j.Neo4j)1 Neo4jHealthCheck (io.helidon.integrations.neo4j.health.Neo4jHealthCheck)1 Neo4jMetricsSupport (io.helidon.integrations.neo4j.metrics.Neo4jMetricsSupport)1 MetricRegistry (org.eclipse.microprofile.metrics.MetricRegistry)1 Driver (org.neo4j.driver.Driver)1