diff --git a/implementation/src/main/java/io/smallrye/metrics/exporters/PrometheusMetricsExporter.java b/implementation/src/main/java/io/smallrye/metrics/exporters/PrometheusMetricsExporter.java index 0706b7c5..01a838a4 100644 --- a/implementation/src/main/java/io/smallrye/metrics/exporters/PrometheusMetricsExporter.java +++ b/implementation/src/main/java/io/smallrye/metrics/exporters/PrometheusMetricsExporter.java @@ -190,6 +190,7 @@ private void resolveMeterSuffixes(Set set, Type inputType) { set.add("_count"); set.add("_sum"); set.add("_max"); + set.add("_bucket"); break; default: if (LOGGER.isLoggable(Level.FINEST)) { diff --git a/implementation/src/main/java/io/smallrye/metrics/setup/config/HistogramBucketMaxConfiguration.java b/implementation/src/main/java/io/smallrye/metrics/setup/config/HistogramBucketMaxConfiguration.java index c73f0d5d..d9b7bdca 100644 --- a/implementation/src/main/java/io/smallrye/metrics/setup/config/HistogramBucketMaxConfiguration.java +++ b/implementation/src/main/java/io/smallrye/metrics/setup/config/HistogramBucketMaxConfiguration.java @@ -53,7 +53,10 @@ public static Collection parse(String input) { } // LIFO - right most configuration takes precedence - metricBucketMinMax.addFirst(metricBucketConfiguration); + if (metricBucketConfiguration != null) { + metricBucketMinMax.addFirst(metricBucketConfiguration); + } + } return metricBucketMinMax; diff --git a/implementation/src/main/java/io/smallrye/metrics/setup/config/HistogramBucketMinConfiguration.java b/implementation/src/main/java/io/smallrye/metrics/setup/config/HistogramBucketMinConfiguration.java index 5e93d7d0..1a142f71 100644 --- a/implementation/src/main/java/io/smallrye/metrics/setup/config/HistogramBucketMinConfiguration.java +++ b/implementation/src/main/java/io/smallrye/metrics/setup/config/HistogramBucketMinConfiguration.java @@ -53,7 +53,10 @@ public static Collection parse(String input) { } // LIFO - right most configuration takes precedence - metricBucketMinMax.addFirst(metricBucketConfiguration); + if (metricBucketConfiguration != null) { + metricBucketMinMax.addFirst(metricBucketConfiguration); + } + } return metricBucketMinMax; diff --git a/implementation/src/main/java/io/smallrye/metrics/setup/config/TimerBucketMaxConfiguration.java b/implementation/src/main/java/io/smallrye/metrics/setup/config/TimerBucketMaxConfiguration.java index 0b0d8922..756e2d41 100644 --- a/implementation/src/main/java/io/smallrye/metrics/setup/config/TimerBucketMaxConfiguration.java +++ b/implementation/src/main/java/io/smallrye/metrics/setup/config/TimerBucketMaxConfiguration.java @@ -34,7 +34,7 @@ public static Collection parse(String input) { String metricName = keyValueSplit[0]; TimerBucketMaxConfiguration sloMinConfiguration = null; - Duration dur; + Duration dur = null; // metricGroup= == invalid if (keyValueSplit.length == 2) { @@ -69,10 +69,13 @@ public static Collection parse(String input) { continue; } - sloMinConfiguration = new TimerBucketMaxConfiguration(metricName, dur); + if (dur != null) { + sloMinConfiguration = new TimerBucketMaxConfiguration(metricName, dur); + + // LIFO - right most configuration takes precedence + sloMinConfigCollection.addFirst(sloMinConfiguration); + } - // LIFO - right most configuration takes precedence - sloMinConfigCollection.addFirst(sloMinConfiguration); } return sloMinConfigCollection; diff --git a/implementation/src/main/java/io/smallrye/metrics/setup/config/TimerBucketMinConfiguration.java b/implementation/src/main/java/io/smallrye/metrics/setup/config/TimerBucketMinConfiguration.java index 1f68a4fe..bd14cfab 100644 --- a/implementation/src/main/java/io/smallrye/metrics/setup/config/TimerBucketMinConfiguration.java +++ b/implementation/src/main/java/io/smallrye/metrics/setup/config/TimerBucketMinConfiguration.java @@ -34,7 +34,7 @@ public static Collection parse(String input) { String metricName = keyValueSplit[0]; TimerBucketMinConfiguration sloMinConfiguration = null; - Duration dur; + Duration dur = null; // metricGroup= == invalid if (keyValueSplit.length == 2) { @@ -69,10 +69,13 @@ public static Collection parse(String input) { continue; } - sloMinConfiguration = new TimerBucketMinConfiguration(metricName, dur); + if (dur != null) { + sloMinConfiguration = new TimerBucketMinConfiguration(metricName, dur); + + // LIFO - right most configuration takes precedence + sloMinConfigCollection.addFirst(sloMinConfiguration); + } - // LIFO - right most configuration takes precedence - sloMinConfigCollection.addFirst(sloMinConfiguration); } return sloMinConfigCollection;