@@ -178,7 +178,8 @@ def _to_bridge
178178 :metric_periodicity ,
179179 :metric_temporality ,
180180 :durations_as_seconds ,
181- :http
181+ :http ,
182+ :histogram_bucket_overrides
182183 )
183184
184185 # Options for exporting metrics to OpenTelemetry.
@@ -197,6 +198,9 @@ def _to_bridge
197198 # +false+.
198199 # @!attribute http
199200 # @return [Boolean] True if the protocol is HTTP, false if gRPC (the default).
201+ # @!attribute histogram_bucket_overrides
202+ # @return [Hash<String, Array<Numeric>>, nil] Override default histogram buckets. Key of the hash it the metric
203+ # name, value is an array of floats for the set of buckets.
200204 class OpenTelemetryMetricsOptions
201205 # OpenTelemetry metric temporality.
202206 module MetricTemporality
@@ -213,13 +217,16 @@ module MetricTemporality
213217 # @param durations_as_seconds [Boolean] Whether to use float seconds instead of integer milliseconds for
214218 # durations.
215219 # @param http [Boolean] True if the protocol is HTTP, false if gRPC (the default).
220+ # @param histogram_bucket_overrides [Hash<String, Array<Numeric>>, nil] Override default histogram buckets. Key of
221+ # the hash it the metric name, value is an array of floats for the set of buckets.
216222 def initialize (
217223 url :,
218224 headers : nil ,
219225 metric_periodicity : nil ,
220226 metric_temporality : MetricTemporality ::CUMULATIVE ,
221227 durations_as_seconds : false ,
222- http : false
228+ http : false ,
229+ histogram_bucket_overrides : nil
223230 )
224231 super
225232 end
@@ -237,7 +244,8 @@ def _to_bridge
237244 else raise 'Unrecognized metric temporality'
238245 end ,
239246 durations_as_seconds :,
240- http :
247+ http :,
248+ histogram_bucket_overrides :
241249 )
242250 end
243251 end
@@ -246,7 +254,8 @@ def _to_bridge
246254 :bind_address ,
247255 :counters_total_suffix ,
248256 :unit_suffix ,
249- :durations_as_seconds
257+ :durations_as_seconds ,
258+ :histogram_bucket_overrides
250259 )
251260
252261 # Options for exporting metrics to Prometheus.
@@ -259,6 +268,9 @@ def _to_bridge
259268 # @return [Boolean] If `true`, all histograms will include the unit in their name as a suffix.
260269 # @!attribute durations_as_seconds
261270 # @return [Boolean] Whether to use float seconds instead of integer milliseconds for durations.
271+ # @!attribute histogram_bucket_overrides
272+ # @return [Hash<String, Array<Numeric>>, nil] Override default histogram buckets. Key of the hash it the metric
273+ # name, value is an array of floats for the set of buckets.
262274 class PrometheusMetricsOptions
263275 # Create Prometheus options.
264276 #
@@ -267,11 +279,14 @@ class PrometheusMetricsOptions
267279 # @param unit_suffix [Boolean] If `true`, all histograms will include the unit in their name as a suffix.
268280 # @param durations_as_seconds [Boolean] Whether to use float seconds instead of integer milliseconds for
269281 # durations.
282+ # @param histogram_bucket_overrides [Hash<String, Array<Numeric>>, nil] Override default histogram buckets. Key of
283+ # the hash it the metric name, value is an array of floats for the set of buckets.
270284 def initialize (
271285 bind_address :,
272286 counters_total_suffix : false ,
273287 unit_suffix : false ,
274- durations_as_seconds : false
288+ durations_as_seconds : false ,
289+ histogram_bucket_overrides : nil
275290 )
276291 super
277292 end
@@ -283,7 +298,8 @@ def _to_bridge
283298 bind_address :,
284299 counters_total_suffix :,
285300 unit_suffix :,
286- durations_as_seconds :
301+ durations_as_seconds :,
302+ histogram_bucket_overrides :
287303 )
288304 end
289305 end
0 commit comments