class PrometheusProtocolFormatter {

    public String format(final List<MBeanMetric> metrics, AppType appType) {
        StringBuilder formattedMetrics = new StringBuilder();

        for (final MBeanMetric metric : metrics) {
            final MBeanResourceMetric resourceMetric = (MBeanResourceMetric) metric;

            formattedMetrics.append("tessera_")
                .append(appType)
                .append("_")
                .append(sanitize(resourceMetric.getResourceMethod()))
                .append("_")
                .append(sanitize(resourceMetric.getName()))
                .append(" ")
                .append(resourceMetric.getValue())
                .append("\n");
        }

        return formattedMetrics.toString().trim();
    }

}