If I use non-integer numbers in buckets for a classic histogram, an error is thrown when scraping metrics
Sample code to reproduce the error
package io.prometheus.metrics.simpleclient.bridge;
import io.prometheus.client.CollectorRegistry;
import io.prometheus.client.Histogram;
import io.prometheus.metrics.model.registry.PrometheusRegistry;
public class Test {
public static void main(String[] args) {
CollectorRegistry origRegistry = new CollectorRegistry();
PrometheusRegistry newRegistry = new PrometheusRegistry();
SimpleclientCollector.builder()
.collectorRegistry(origRegistry)
.register(newRegistry);
Histogram histogram = Histogram.build()
.name("response_size_bytes")
.help("response size in Bytes")
.labelNames("status")
.buckets(0.01, 0.1)
.register(origRegistry);
histogram.labels("200").observe(1);
newRegistry.scrape(); // throws IllegalArgumentException: Counts in ClassicHistogramBuckets cannot be negative.
}
}