code: public static void setRegistry(Registry registry) {
      SpectatorContext.registry = registry;
      if (registry instanceof NoopRegistry) {
        initStacktrace = null;
      } else {
        Exception cause = initStacktrace;
        Exception e = new IllegalStateException(
            "called SpectatorContext.setRegistry(" + registry.getClass().getName() + ")",
            cause);
        e.fillInStackTrace();
        initStacktrace = e;
        if (cause != null) {
          LOGGER.warn("Registry used with Servo's SpectatorContext has been overwritten. This could "
              + "result in missing metrics.", e);
        }
      }
    }
docs: Set the registry to use. By default it will use the NoopRegistry.