private HttpServer setupWebserver(Handler<AsyncResult<HttpServer>> listenHandler) {
        String port = componentConfig.get("port");
        Objects.requireNonNull(port, "Must specify port for scrape server to listen on");
        return vertx.createHttpServer().requestHandler(request -> {
            HttpServerResponse response = request.response();
            StringWriter sw = new StringWriter();
            try {
                TextFormat.write004(sw, collectorRegistry.metricFamilySamples());
                response.setStatusCode(200)
                    .putHeader("Content-Type", TextFormat.CONTENT_TYPE_004)
                    .setChunked(true)
                    .write(sw.toString());
            } catch (Exception e) {
                response.setStatusCode(500)
                    .write(Json.encode(e));
            }
            response.end();
        }).listen(Integer.parseInt(port), listenHandler);
    }
Prometheus scrape metrics.

Config:
<ul>
  <li>port - port for web-server to listen on for scrape requests</li>
</ul>

@author Marc Savy {@literal <msavy@redhat.com>}
gateway/engine/prometheus/src/main/java/io/apiman/gateway/engine/prometheus/PrometheusScrapeMetrics.java