You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Prometheus example is a bit confusing, with three histogram measurements resulting in only two buckets (2x +Inf), each with a value of 1:
# HELP ex_com_two
# TYPE ex_com_two histogram
ex_com_two_bucket{ex_com_lemons="13",service_name="unknown_service:prometheus",telemetry_sdk_language="go",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="1.2.0",le="+Inf"} 1
ex_com_two_sum{ex_com_lemons="13",service_name="unknown_service:prometheus",telemetry_sdk_language="go",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="1.2.0"} 2
ex_com_two_count{ex_com_lemons="13",service_name="unknown_service:prometheus",telemetry_sdk_language="go",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="1.2.0"} 1
ex_com_two_bucket{A="1",B="2",C="3",ex_com_lemons="10",service_name="unknown_service:prometheus",telemetry_sdk_language="go",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="1.2.0",le="+Inf"} 1
ex_com_two_sum{A="1",B="2",C="3",ex_com_lemons="10",service_name="unknown_service:prometheus",telemetry_sdk_language="go",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="1.2.0"} 2
ex_com_two_count{A="1",B="2",C="3",ex_com_lemons="10",service_name="unknown_service:prometheus",telemetry_sdk_language="go",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="1.2.0"} 1
Reading the code, I would expect multiple buckets, some of them perhaps empty. Turns out, config.DefaultHistogramBoundaries is an empty list of values:
Changing the example so that the first param to the factory is selector.NewWithHistogramDistribution() results in the following, which is already closer to my expectation:
Description
The Prometheus example is a bit confusing, with three histogram measurements resulting in only two buckets (2x +Inf), each with a value of
1
:Reading the code, I would expect multiple buckets, some of them perhaps empty. Turns out,
config.DefaultHistogramBoundaries
is an empty list of values:opentelemetry-go/example/prometheus/main.go
Lines 41 to 50 in f1971b3
Changing the example so that the first param to the factory is
selector.NewWithHistogramDistribution()
results in the following, which is already closer to my expectation:Perhaps the example could show how to specify explicit buckets. For instance, by changing the original example to have the following config:
This would result in the following buckets:
Environment
Steps To Reproduce
The text was updated successfully, but these errors were encountered: