Search in sources :

Example 1 with PrometheusMetricsHandler

use of com.amazon.dataprepper.pipeline.server.PrometheusMetricsHandler in project data-prepper by opensearch-project.

the class DataPrepperServerConfiguration method httpServer.

@Bean
public HttpServer httpServer(final HttpServerProvider httpServerProvider, final ListPipelinesHandler listPipelinesHandler, final ShutdownHandler shutdownHandler, @Autowired(required = false) @Nullable final PrometheusMeterRegistry prometheusMeterRegistry, @Autowired(required = false) @Nullable final Authenticator authenticator) {
    final HttpServer server = httpServerProvider.get();
    createContext(server, listPipelinesHandler, authenticator, "/list");
    createContext(server, shutdownHandler, authenticator, "/shutdown");
    if (prometheusMeterRegistry != null) {
        final PrometheusMetricsHandler prometheusMetricsHandler = new PrometheusMetricsHandler(prometheusMeterRegistry);
        createContext(server, prometheusMetricsHandler, authenticator, "/metrics/prometheus", "/metrics/sys");
    }
    return server;
}
Also used : HttpServer(com.sun.net.httpserver.HttpServer) PrometheusMetricsHandler(com.amazon.dataprepper.pipeline.server.PrometheusMetricsHandler) Bean(org.springframework.context.annotation.Bean)

Aggregations

PrometheusMetricsHandler (com.amazon.dataprepper.pipeline.server.PrometheusMetricsHandler)1 HttpServer (com.sun.net.httpserver.HttpServer)1 Bean (org.springframework.context.annotation.Bean)1