Class: Temporalio::Runtime::PrometheusMetricsOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/temporalio/runtime.rb

Overview

Options for exporting metrics to Prometheus.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bind_address:, counters_total_suffix: false, unit_suffix: false, durations_as_seconds: false, histogram_bucket_overrides: nil) ⇒ PrometheusMetricsOptions

Create Prometheus options.

Parameters:

  • bind_address (String)

    Address to bind to for Prometheus endpoint.

  • counters_total_suffix (Boolean) (defaults to: false)

    If ‘true`, all counters will include a `_total` suffix.

  • unit_suffix (Boolean) (defaults to: false)

    If ‘true`, all histograms will include the unit in their name as a suffix.

  • durations_as_seconds (Boolean) (defaults to: false)

    Whether to use float seconds instead of integer milliseconds for durations.

  • histogram_bucket_overrides (Hash<String, Array<Numeric>>, nil) (defaults to: nil)

    Override default histogram buckets. Key of the hash it the metric name, value is an array of floats for the set of buckets.



284
285
286
287
288
289
290
291
292
# File 'lib/temporalio/runtime.rb', line 284

def initialize(
  bind_address:,
  counters_total_suffix: false,
  unit_suffix: false,
  durations_as_seconds: false,
  histogram_bucket_overrides: nil
)
  super
end

Instance Attribute Details

#bind_addressString

Returns Address to bind to for Prometheus endpoint.

Returns:

  • (String)

    Address to bind to for Prometheus endpoint.



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/temporalio/runtime.rb', line 274

class PrometheusMetricsOptions
  # Create Prometheus options.
  #
  # @param bind_address [String] Address to bind to for Prometheus endpoint.
  # @param counters_total_suffix [Boolean] If `true`, all counters will include a `_total` suffix.
  # @param unit_suffix [Boolean] If `true`, all histograms will include the unit in their name as a suffix.
  # @param durations_as_seconds [Boolean] Whether to use float seconds instead of integer milliseconds for
  #   durations.
  # @param histogram_bucket_overrides [Hash<String, Array<Numeric>>, nil] Override default histogram buckets. Key of
  #   the hash it the metric name, value is an array of floats for the set of buckets.
  def initialize(
    bind_address:,
    counters_total_suffix: false,
    unit_suffix: false,
    durations_as_seconds: false,
    histogram_bucket_overrides: nil
  )
    super
  end

  # @!visibility private
  def _to_bridge
    # @type self: PrometheusMetricsOptions
    Internal::Bridge::Runtime::PrometheusMetricsOptions.new(
      bind_address:,
      counters_total_suffix:,
      unit_suffix:,
      durations_as_seconds:,
      histogram_bucket_overrides:
    )
  end
end

#counters_total_suffixBoolean

Returns If ‘true`, all counters will include a `_total` suffix.

Returns:

  • (Boolean)

    If ‘true`, all counters will include a `_total` suffix.



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/temporalio/runtime.rb', line 274

class PrometheusMetricsOptions
  # Create Prometheus options.
  #
  # @param bind_address [String] Address to bind to for Prometheus endpoint.
  # @param counters_total_suffix [Boolean] If `true`, all counters will include a `_total` suffix.
  # @param unit_suffix [Boolean] If `true`, all histograms will include the unit in their name as a suffix.
  # @param durations_as_seconds [Boolean] Whether to use float seconds instead of integer milliseconds for
  #   durations.
  # @param histogram_bucket_overrides [Hash<String, Array<Numeric>>, nil] Override default histogram buckets. Key of
  #   the hash it the metric name, value is an array of floats for the set of buckets.
  def initialize(
    bind_address:,
    counters_total_suffix: false,
    unit_suffix: false,
    durations_as_seconds: false,
    histogram_bucket_overrides: nil
  )
    super
  end

  # @!visibility private
  def _to_bridge
    # @type self: PrometheusMetricsOptions
    Internal::Bridge::Runtime::PrometheusMetricsOptions.new(
      bind_address:,
      counters_total_suffix:,
      unit_suffix:,
      durations_as_seconds:,
      histogram_bucket_overrides:
    )
  end
end

#durations_as_secondsBoolean

Returns Whether to use float seconds instead of integer milliseconds for durations.

Returns:

  • (Boolean)

    Whether to use float seconds instead of integer milliseconds for durations.



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/temporalio/runtime.rb', line 274

class PrometheusMetricsOptions
  # Create Prometheus options.
  #
  # @param bind_address [String] Address to bind to for Prometheus endpoint.
  # @param counters_total_suffix [Boolean] If `true`, all counters will include a `_total` suffix.
  # @param unit_suffix [Boolean] If `true`, all histograms will include the unit in their name as a suffix.
  # @param durations_as_seconds [Boolean] Whether to use float seconds instead of integer milliseconds for
  #   durations.
  # @param histogram_bucket_overrides [Hash<String, Array<Numeric>>, nil] Override default histogram buckets. Key of
  #   the hash it the metric name, value is an array of floats for the set of buckets.
  def initialize(
    bind_address:,
    counters_total_suffix: false,
    unit_suffix: false,
    durations_as_seconds: false,
    histogram_bucket_overrides: nil
  )
    super
  end

  # @!visibility private
  def _to_bridge
    # @type self: PrometheusMetricsOptions
    Internal::Bridge::Runtime::PrometheusMetricsOptions.new(
      bind_address:,
      counters_total_suffix:,
      unit_suffix:,
      durations_as_seconds:,
      histogram_bucket_overrides:
    )
  end
end

#histogram_bucket_overridesHash<String, Array<Numeric>>?

Returns Override default histogram buckets. Key of the hash it the metric name, value is an array of floats for the set of buckets.

Returns:

  • (Hash<String, Array<Numeric>>, nil)

    Override default histogram buckets. Key of the hash it the metric name, value is an array of floats for the set of buckets.



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/temporalio/runtime.rb', line 274

class PrometheusMetricsOptions
  # Create Prometheus options.
  #
  # @param bind_address [String] Address to bind to for Prometheus endpoint.
  # @param counters_total_suffix [Boolean] If `true`, all counters will include a `_total` suffix.
  # @param unit_suffix [Boolean] If `true`, all histograms will include the unit in their name as a suffix.
  # @param durations_as_seconds [Boolean] Whether to use float seconds instead of integer milliseconds for
  #   durations.
  # @param histogram_bucket_overrides [Hash<String, Array<Numeric>>, nil] Override default histogram buckets. Key of
  #   the hash it the metric name, value is an array of floats for the set of buckets.
  def initialize(
    bind_address:,
    counters_total_suffix: false,
    unit_suffix: false,
    durations_as_seconds: false,
    histogram_bucket_overrides: nil
  )
    super
  end

  # @!visibility private
  def _to_bridge
    # @type self: PrometheusMetricsOptions
    Internal::Bridge::Runtime::PrometheusMetricsOptions.new(
      bind_address:,
      counters_total_suffix:,
      unit_suffix:,
      durations_as_seconds:,
      histogram_bucket_overrides:
    )
  end
end

#unit_suffixBoolean

Returns If ‘true`, all histograms will include the unit in their name as a suffix.

Returns:

  • (Boolean)

    If ‘true`, all histograms will include the unit in their name as a suffix.



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/temporalio/runtime.rb', line 274

class PrometheusMetricsOptions
  # Create Prometheus options.
  #
  # @param bind_address [String] Address to bind to for Prometheus endpoint.
  # @param counters_total_suffix [Boolean] If `true`, all counters will include a `_total` suffix.
  # @param unit_suffix [Boolean] If `true`, all histograms will include the unit in their name as a suffix.
  # @param durations_as_seconds [Boolean] Whether to use float seconds instead of integer milliseconds for
  #   durations.
  # @param histogram_bucket_overrides [Hash<String, Array<Numeric>>, nil] Override default histogram buckets. Key of
  #   the hash it the metric name, value is an array of floats for the set of buckets.
  def initialize(
    bind_address:,
    counters_total_suffix: false,
    unit_suffix: false,
    durations_as_seconds: false,
    histogram_bucket_overrides: nil
  )
    super
  end

  # @!visibility private
  def _to_bridge
    # @type self: PrometheusMetricsOptions
    Internal::Bridge::Runtime::PrometheusMetricsOptions.new(
      bind_address:,
      counters_total_suffix:,
      unit_suffix:,
      durations_as_seconds:,
      histogram_bucket_overrides:
    )
  end
end