@@ -178,7 +178,8 @@ def _to_bridge
178
178
:metric_periodicity ,
179
179
:metric_temporality ,
180
180
:durations_as_seconds ,
181
- :http
181
+ :http ,
182
+ :histogram_bucket_overrides
182
183
)
183
184
184
185
# Options for exporting metrics to OpenTelemetry.
@@ -197,6 +198,9 @@ def _to_bridge
197
198
# +false+.
198
199
# @!attribute http
199
200
# @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.
200
204
class OpenTelemetryMetricsOptions
201
205
# OpenTelemetry metric temporality.
202
206
module MetricTemporality
@@ -213,13 +217,16 @@ module MetricTemporality
213
217
# @param durations_as_seconds [Boolean] Whether to use float seconds instead of integer milliseconds for
214
218
# durations.
215
219
# @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.
216
222
def initialize (
217
223
url :,
218
224
headers : nil ,
219
225
metric_periodicity : nil ,
220
226
metric_temporality : MetricTemporality ::CUMULATIVE ,
221
227
durations_as_seconds : false ,
222
- http : false
228
+ http : false ,
229
+ histogram_bucket_overrides : nil
223
230
)
224
231
super
225
232
end
@@ -237,7 +244,8 @@ def _to_bridge
237
244
else raise 'Unrecognized metric temporality'
238
245
end ,
239
246
durations_as_seconds :,
240
- http :
247
+ http :,
248
+ histogram_bucket_overrides :
241
249
)
242
250
end
243
251
end
@@ -246,7 +254,8 @@ def _to_bridge
246
254
:bind_address ,
247
255
:counters_total_suffix ,
248
256
:unit_suffix ,
249
- :durations_as_seconds
257
+ :durations_as_seconds ,
258
+ :histogram_bucket_overrides
250
259
)
251
260
252
261
# Options for exporting metrics to Prometheus.
@@ -259,6 +268,9 @@ def _to_bridge
259
268
# @return [Boolean] If `true`, all histograms will include the unit in their name as a suffix.
260
269
# @!attribute durations_as_seconds
261
270
# @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.
262
274
class PrometheusMetricsOptions
263
275
# Create Prometheus options.
264
276
#
@@ -267,11 +279,14 @@ class PrometheusMetricsOptions
267
279
# @param unit_suffix [Boolean] If `true`, all histograms will include the unit in their name as a suffix.
268
280
# @param durations_as_seconds [Boolean] Whether to use float seconds instead of integer milliseconds for
269
281
# 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.
270
284
def initialize (
271
285
bind_address :,
272
286
counters_total_suffix : false ,
273
287
unit_suffix : false ,
274
- durations_as_seconds : false
288
+ durations_as_seconds : false ,
289
+ histogram_bucket_overrides : nil
275
290
)
276
291
super
277
292
end
@@ -283,7 +298,8 @@ def _to_bridge
283
298
bind_address :,
284
299
counters_total_suffix :,
285
300
unit_suffix :,
286
- durations_as_seconds :
301
+ durations_as_seconds :,
302
+ histogram_bucket_overrides :
287
303
)
288
304
end
289
305
end
0 commit comments