@Override
  public CompletableFuture<?> start() {
    LOG.info("Starting metrics http service on {}:{}", config.getHost(), config.getPort());

    try {
      httpServer =
          HTTPServer.builder()
              .hostname(config.getHost())
              .port(config.getPort())
              .registry(metricsSystem.getRegistry())
              .authenticator(
                  new Authenticator() {
                    @Override
                    public Result authenticate(final HttpExchange exch) {
                      return checkAllowlistHostHeader(exch);
                    }
                  })
              .defaultHandler(new RestrictedDefaultHandler())
              .buildAndStart();

      return CompletableFuture.completedFuture(null);
    } catch (final Throwable e) {
      return CompletableFuture.failedFuture(e);
    }
  }
Instantiates a new Metrics http service.

@param configuration the configuration
@param metricsSystem the metrics system
metrics/core/src/main/java/org/hyperledger/besu/metrics/prometheus/MetricsHttpService.java