diff --git a/solr/core/src/java/org/apache/solr/servlet/PrometheusMetricsServlet.java b/solr/core/src/java/org/apache/solr/servlet/PrometheusMetricsServlet.java index 406c78d1e4a..7eefd527f68 100644 --- a/solr/core/src/java/org/apache/solr/servlet/PrometheusMetricsServlet.java +++ b/solr/core/src/java/org/apache/solr/servlet/PrometheusMetricsServlet.java @@ -1111,11 +1111,10 @@ private abstract static class MetricsByPrefixApiCaller extends MetricsApiCaller @Override protected String buildQueryString(ResultContext resultContext) { String propertyClause = - String.join( - "&property=", - Arrays.stream(properties) - .map(p -> URLEncoder.encode(p, StandardCharsets.UTF_8)) - .collect(Collectors.toSet())); + Arrays.stream(properties) + .map(p -> URLEncoder.encode(p, StandardCharsets.UTF_8)) + .distinct() + .collect(Collectors.joining(",", "&property=", "")); return String.format( Locale.ROOT, "wt=json&indent=false&compact=true&group=%s&prefix=%s%s",