Source:
<code>public void start() throws Exception { log.info("[init] running spawn2 on port " + configuration.webPort + (sslEnabled ? (" and port " + configuration.webPortSSL) : "")); ResourceHandler resourceHandler = new ResourceHandler(); resourceHandler.setDirectoriesListed(true); resourceHandler.setWelcomeFiles(new String[]{INDEX_FILENAME}); resourceHandler.setResourceBase(WEB_DIR); resourceHandler.setCacheControl("max-age=" + SPAWN_RESOURCE_MAX_AGE_SECONDS); ServletContextHandler handler = new ServletContextHandler(); webSocketManager.setHandler(handler); HandlerList handlers = new HandlerList(); handlers.setHandlers(new Handler[]{resourceHandler, webSocketManager}); GzipHandler gzipHandler = new GzipHandler(); gzipHandler.setHandler(handlers); ServletContainer servletContainer = new ServletContainer(servlets); ServletHolder sh = new ServletHolder(servletContainer); handler.addFilter(GzipFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST)); <START> handler.addServlet(new ServletHolder(new MetricsServlet()), "/yammer_metrics"); <END> handler.addServlet(sh, "/*"); PrometheusServletCreator.create(jetty, handler); jetty.setAttribute("org.eclipse.jetty.Request.maxFormContentSize", 5000000); jetty.setHandler(gzipHandler); jetty.start(); jetty.addLifeCycleListener(new AbstractLifeCycle.AbstractLifeCycleListener() { @Override public void lifeCycleStopping(LifeCycle event) { super.lifeCycleStopping(event); try { resourceCloser.close(); } catch (IOException ex) { log.error("IOException while closing jetty resources: ", ex); } } }); }</code><technical_language>I agree /yammer_metrics path in of servlets, especially currently called dropwizard metrics. In addition, do want servlets for Dropwizard metrics Prometheus metrics</technical_language>

Target:
public void start() throws Exception { log.info("[init] running spawn2 on port " + configuration.webPort + (sslEnabled ? (" and port " + configuration.webPortSSL) : "")); ResourceHandler resourceHandler = new ResourceHandler(); resourceHandler.setDirectoriesListed(true); resourceHandler.setWelcomeFiles(new String[]{INDEX_FILENAME}); resourceHandler.setResourceBase(WEB_DIR); resourceHandler.setCacheControl("max-age=" + SPAWN_RESOURCE_MAX_AGE_SECONDS); ServletContextHandler handler = new ServletContextHandler(); webSocketManager.setHandler(handler); HandlerList handlers = new HandlerList(); handlers.setHandlers(new Handler[]{resourceHandler, webSocketManager}); GzipHandler gzipHandler = new GzipHandler(); gzipHandler.setHandler(handlers); ServletContainer servletContainer = new ServletContainer(servlets); ServletHolder sh = new ServletHolder(servletContainer); handler.addFilter(GzipFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST)); handler.addServlet(sh, "/*"); PrometheusServletCreator.create(jetty, handler); jetty.setAttribute("org.eclipse.jetty.Request.maxFormContentSize", 5000000); jetty.setHandler(gzipHandler); jetty.start(); jetty.addLifeCycleListener(new AbstractLifeCycle.AbstractLifeCycleListener() { @Override public void lifeCycleStopping(LifeCycle event) { super.lifeCycleStopping(event); try { resourceCloser.close(); } catch (IOException ex) { log.error("IOException while closing jetty resources: ", ex); } } }); }