public String format(VespaService service, String name, Number value) {
        StringBuilder sb = new StringBuilder();

        if (includeServiceName) {
            sb.append(service.getServiceName()).append(".");
        }

        if (isSystemMetric)
            sb.append(toSystemServiceId(service.getConfigId()));
        else
            sb.append(toServiceId(service.getConfigId()));

        sb.append(".")
                .append(formatMetricName(name))
                .append("=");

        if (value instanceof Double) {
            sb.append(df.format(value.doubleValue()));
        } else {
            sb.append(value.toString());
        }

        return sb.toString();
    }
Format metrics as required by users of the "getMetricsById" rpc method.

@author Unknown
metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/MetricsFormatter.java