implementation/src/main/java/io/smallrye/metrics/exporters/JsonExporter.java
private String createTagsString(Map<String, String> tags) {
        if (tags == null) {
            return "";
        } else {
            Map<String, String> withGlobalTags = new TreeMap<>(tags);
            withGlobalTags.putAll(globalTags);
            if (withGlobalTags.isEmpty()) {
                return "";
            }
            return ";" + withGlobalTags.entrySet().stream()
                    .map(tag -> tag.getKey() + "=" + tag.getValue()
                            .replaceAll(";", "_"))
                    //                            .replaceAll("\"", "\\\\\""))  // this is done by JSON-P automatically
                    //                            .replaceAll("\n", "\\\\n"))  // this is done by JSON-P automatically
                    .collect(Collectors.joining(";"));
        }
    }
/**
     * Converts a list of tags to the string that will be appended to the metric name in JSON output.
     * If there are no tags, this returns an empty string.
     */
Converts a list of tags to the string that will be appended to the metric name in JSON output.
If there are no tags, this returns an empty string.
Converts a list of tags to the string that will be appended to the metric name in JSON output . If there are no tags this returns an empty string .
private String createTagsString(Map<String, String> tags) {
        if (tags == null) {
            return "";
        } else {
            Map<String, String> withGlobalTags = new TreeMap<>(tags);
            withGlobalTags.putAll(globalTags);
            if (withGlobalTags.isEmpty()) {
                return "";
            }
            return ";" + withGlobalTags.entrySet().stream()
                    .map(tag -> tag.getKey() + "=" + tag.getValue()
                            .replaceAll(";", "_"))
                    .collect(Collectors.joining(";"));
        }
    }
private String createTagsString ( Map < String , String > tags ) { if ( tags == null ) { return "" ; } else { Map < String , String > withGlobalTags = new TreeMap < > ( tags ) ; withGlobalTags . putAll ( globalTags ) ; if ( withGlobalTags . isEmpty ( ) ) { return "" ; } return ";" + withGlobalTags . entrySet ( ) . stream ( ) . map ( tag -> tag . getKey ( ) + "=" + tag . getValue ( ) . replaceAll ( ";" , "_" ) ) . collect ( Collectors . joining ( ";" ) ) ; } }
Converts a list of tags to the string that will be appended to the metric name in JSON output.
Converts a list of tags to the string that will be appended to the metric name in JSON output .
//                            .replaceAll("\"", "\\\\\""))  // this is done by JSON-P automatically //                            .replaceAll("\n", "\\\\n"))  // this is done by JSON-P automatically