@Override
    protected HttpResponse doGet(ServiceRequestContext ctx, HttpRequest req) throws Exception {
        final String accept = req.headers().get(HttpHeaderNames.ACCEPT);
        final ByteBuf buffer = ctx.alloc().buffer();
        final String format;
        boolean success = false;
        try (ByteBufOutputStream byteBufOutputStream = new ByteBufOutputStream(buffer)) {
            final ExpositionFormatWriter writer = expositionFormats.findWriter(accept);
            format = writer.getContentType();
            writer.write(byteBufOutputStream, prometheusRegistry.scrape());
            success = true;
        } finally {
            if (!success) {
                buffer.release();
            }
        }
        return HttpResponse.of(HttpStatus.OK, MediaType.parse(format), HttpData.wrap(buffer));
    }
Returns a new {@link PrometheusExpositionServiceBuilder} created with the specified
{@link PrometheusRegistry}.
prometheus1/src/main/java/com/linecorp/armeria/server/prometheus/PrometheusExpositionService.java