@Override public void init(ServletConfig config) throws ServletException { super.init(config); this.healthCheckServlet = new HealthCheckServlet(); healthCheckServlet.init(config); this.metricsServlet = new MetricsServlet(); metricsServlet.init(config); this.pingServlet = new PingServlet(); pingServlet.init(config); this.threadDumpServlet = new ThreadDumpServlet(); threadDumpServlet.init(config); this.metricsUri = getParam(config.getInitParameter("metrics-uri"), DEFAULT_METRICS_URI); this.pingUri = getParam(config.getInitParameter("ping-uri"), DEFAULT_PING_URI); this.threadsUri = getParam(config.getInitParameter("threads-uri"), DEFAULT_THREADS_URI); this.healthcheckUri = getParam(config.getInitParameter("healthcheck-uri"), DEFAULT_HEALTHCHECK_URI); this.serviceName = getParam(config.getInitParameter("service-name"), null); }
@Activate protected void activate() throws NamespaceException, ServletException { httpService.registerServlet(METRICS_URI, new MetricsServlet(metricRegistry), null, null); httpService.registerServlet(HEALTH_URI, new HealthCheckServlet(healthCheckRegistry), null, null); httpService.registerServlet(PING_URI, new PingServlet(), null, null); httpService.registerServlet(THREADS_URI, new ThreadDumpServlet(), null, null); }
serve(SYSTEM_METRICS).with(new MetricsServlet(monitoring.getMetrics())); serve(SYSTEM_PING).with(new PingServlet()); serve(SYSTEM_THREADS).with(new ThreadDumpServlet());
serve(SYSTEM_METRICS).with(new MetricsServlet(monitoring.getMetrics())); serve(SYSTEM_PING).with(new PingServlet()); serve(SYSTEM_THREADS).with(new ThreadDumpServlet());
servletContextHandler.addServlet(new ServletHolder(new ThreadDumpServlet()), STATUS_THREADS_PATH);