@Bean(name = BEAN_GC_STORAGE_LOAD_TIME)
public Timer timerGcsLoadTime() {
return Timer.builder(BEAN_GC_STORAGE_LOAD_TIME)
.description(
"This timer is used to calculate time for load operation from Google Cloud Storage")
.publishPercentiles(0.5, 0.95)
.publishPercentileHistogram(true)
.register(meterRegistry);
}
Example:
# HELP test_gc_storage_load_time_seconds This timer is used to calculate time for load operation from Google Cloud Storage
# TYPE test_gc_storage_load_time_seconds histogram
test_gc_storage_load_time_seconds{quantile="0.5",} 0.0
test_gc_storage_load_time_seconds{quantile="0.95",} 0.0
test_gc_storage_load_time_seconds_bucket{le="0.001",} 0.0
test_gc_storage_load_time_seconds_bucket{le="0.001048576",} 0.0
test_gc_storage_load_time_seconds_bucket{le="0.001398101",} 0.0
Hi, Quantile support was added to summary with https://github.com/census-instrumentation/opencensus-service/commit/b5a7ae3017eb4e377cced3507d819b7ab72803a1 but not to histogram. According to Prometheus docs "You can use both summaries and histograms to calculate so-called φ-quantiles" - https://prometheus.io/docs/practices/histograms/#quantiles.
Java allows adding quantiles to histogram
Example: