From e716b58e95b40ae4d2974be3454c4870714893a3 Mon Sep 17 00:00:00 2001 From: Michael Gibney Date: Tue, 17 Dec 2024 11:14:41 -0500 Subject: [PATCH] SAI-5303: Fix metrics api caller request property formatting/missing metrics (#243) --- .../apache/solr/servlet/PrometheusMetricsServlet.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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",