@Override public void contextInitialized(ServletContextEvent event) { /* * There is a codahale listener which does this, but the logic is done here to reduce the number * of context listeners. */ event.getServletContext().setAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE, getMetricRegistry()); super.contextInitialized(event); }