Class: Temporalio::Runtime::OpenTelemetryMetricsOptions

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

Overview

Options for exporting metrics to OpenTelemetry.

Defined Under Namespace

Modules: MetricTemporality

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url:, headers: nil, metric_periodicity: nil, metric_temporality: MetricTemporality::CUMULATIVE, durations_as_seconds: false) ⇒ OpenTelemetryMetricsOptions

Create OpenTelemetry options.

Parameters:

  • url (String)

    URL for OpenTelemetry endpoint.

  • headers (Hash<String, String>, nil) (defaults to: nil)

    Headers for OpenTelemetry endpoint.

  • metric_periodicity (Float, nil) (defaults to: nil)

    How frequently metrics should be exported, unset uses internal default.

  • metric_temporality (MetricTemporality) (defaults to: MetricTemporality::CUMULATIVE)

    How frequently metrics should be exported.

  • durations_as_seconds (Boolean) (defaults to: false)

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



199
200
201
202
203
204
205
206
207
# File 'lib/temporalio/runtime.rb', line 199

def initialize(
  url:,
  headers: nil,
  metric_periodicity: nil,
  metric_temporality: MetricTemporality::CUMULATIVE,
  durations_as_seconds: false
)
  super
end

Instance Attribute Details

#durations_as_secondsBoolean

Returns Whether to use float seconds instead of integer milliseconds for durations, default is false.

Returns:

  • (Boolean)

    Whether to use float seconds instead of integer milliseconds for durations, default is false.



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/temporalio/runtime.rb', line 184

class OpenTelemetryMetricsOptions
  # OpenTelemetry metric temporality.
  module MetricTemporality
    CUMULATIVE = 1
    DELTA = 2
  end

  # Create OpenTelemetry options.
  #
  # @param url [String] URL for OpenTelemetry endpoint.
  # @param headers [Hash<String, String>, nil] Headers for OpenTelemetry endpoint.
  # @param metric_periodicity [Float, nil] How frequently metrics should be exported, unset uses internal default.
  # @param metric_temporality [MetricTemporality] How frequently metrics should be exported.
  # @param durations_as_seconds [Boolean] Whether to use float seconds instead of integer milliseconds for
  #   durations.
  def initialize(
    url:,
    headers: nil,
    metric_periodicity: nil,
    metric_temporality: MetricTemporality::CUMULATIVE,
    durations_as_seconds: false
  )
    super
  end

  # @!visibility private
  def _to_bridge
    # @type self: OpenTelemetryMetricsOptions
    Internal::Bridge::Runtime::OpenTelemetryMetricsOptions.new(
      url:,
      headers:,
      metric_periodicity:,
      metric_temporality_delta: case metric_temporality
                                when MetricTemporality::CUMULATIVE then false
                                when MetricTemporality::DELTA then true
                                else raise 'Unrecognized metric temporality'
                                end,
      durations_as_seconds:
    )
  end
end

#headersHash<String, String>?

Returns Headers for OpenTelemetry endpoint.

Returns:

  • (Hash<String, String>, nil)

    Headers for OpenTelemetry endpoint.



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/temporalio/runtime.rb', line 184

class OpenTelemetryMetricsOptions
  # OpenTelemetry metric temporality.
  module MetricTemporality
    CUMULATIVE = 1
    DELTA = 2
  end

  # Create OpenTelemetry options.
  #
  # @param url [String] URL for OpenTelemetry endpoint.
  # @param headers [Hash<String, String>, nil] Headers for OpenTelemetry endpoint.
  # @param metric_periodicity [Float, nil] How frequently metrics should be exported, unset uses internal default.
  # @param metric_temporality [MetricTemporality] How frequently metrics should be exported.
  # @param durations_as_seconds [Boolean] Whether to use float seconds instead of integer milliseconds for
  #   durations.
  def initialize(
    url:,
    headers: nil,
    metric_periodicity: nil,
    metric_temporality: MetricTemporality::CUMULATIVE,
    durations_as_seconds: false
  )
    super
  end

  # @!visibility private
  def _to_bridge
    # @type self: OpenTelemetryMetricsOptions
    Internal::Bridge::Runtime::OpenTelemetryMetricsOptions.new(
      url:,
      headers:,
      metric_periodicity:,
      metric_temporality_delta: case metric_temporality
                                when MetricTemporality::CUMULATIVE then false
                                when MetricTemporality::DELTA then true
                                else raise 'Unrecognized metric temporality'
                                end,
      durations_as_seconds:
    )
  end
end

#metric_periodicityFloat?

Returns How frequently metrics should be exported, unset uses internal default.

Returns:

  • (Float, nil)

    How frequently metrics should be exported, unset uses internal default.



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/temporalio/runtime.rb', line 184

class OpenTelemetryMetricsOptions
  # OpenTelemetry metric temporality.
  module MetricTemporality
    CUMULATIVE = 1
    DELTA = 2
  end

  # Create OpenTelemetry options.
  #
  # @param url [String] URL for OpenTelemetry endpoint.
  # @param headers [Hash<String, String>, nil] Headers for OpenTelemetry endpoint.
  # @param metric_periodicity [Float, nil] How frequently metrics should be exported, unset uses internal default.
  # @param metric_temporality [MetricTemporality] How frequently metrics should be exported.
  # @param durations_as_seconds [Boolean] Whether to use float seconds instead of integer milliseconds for
  #   durations.
  def initialize(
    url:,
    headers: nil,
    metric_periodicity: nil,
    metric_temporality: MetricTemporality::CUMULATIVE,
    durations_as_seconds: false
  )
    super
  end

  # @!visibility private
  def _to_bridge
    # @type self: OpenTelemetryMetricsOptions
    Internal::Bridge::Runtime::OpenTelemetryMetricsOptions.new(
      url:,
      headers:,
      metric_periodicity:,
      metric_temporality_delta: case metric_temporality
                                when MetricTemporality::CUMULATIVE then false
                                when MetricTemporality::DELTA then true
                                else raise 'Unrecognized metric temporality'
                                end,
      durations_as_seconds:
    )
  end
end

#metric_temporalityMetricTemporality

Returns How frequently metrics should be exported, default is Temporalio::Runtime::OpenTelemetryMetricsOptions::MetricTemporality::CUMULATIVE.

Returns:



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/temporalio/runtime.rb', line 184

class OpenTelemetryMetricsOptions
  # OpenTelemetry metric temporality.
  module MetricTemporality
    CUMULATIVE = 1
    DELTA = 2
  end

  # Create OpenTelemetry options.
  #
  # @param url [String] URL for OpenTelemetry endpoint.
  # @param headers [Hash<String, String>, nil] Headers for OpenTelemetry endpoint.
  # @param metric_periodicity [Float, nil] How frequently metrics should be exported, unset uses internal default.
  # @param metric_temporality [MetricTemporality] How frequently metrics should be exported.
  # @param durations_as_seconds [Boolean] Whether to use float seconds instead of integer milliseconds for
  #   durations.
  def initialize(
    url:,
    headers: nil,
    metric_periodicity: nil,
    metric_temporality: MetricTemporality::CUMULATIVE,
    durations_as_seconds: false
  )
    super
  end

  # @!visibility private
  def _to_bridge
    # @type self: OpenTelemetryMetricsOptions
    Internal::Bridge::Runtime::OpenTelemetryMetricsOptions.new(
      url:,
      headers:,
      metric_periodicity:,
      metric_temporality_delta: case metric_temporality
                                when MetricTemporality::CUMULATIVE then false
                                when MetricTemporality::DELTA then true
                                else raise 'Unrecognized metric temporality'
                                end,
      durations_as_seconds:
    )
  end
end

#urlString

Returns URL for OpenTelemetry endpoint.

Returns:

  • (String)

    URL for OpenTelemetry endpoint.



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/temporalio/runtime.rb', line 184

class OpenTelemetryMetricsOptions
  # OpenTelemetry metric temporality.
  module MetricTemporality
    CUMULATIVE = 1
    DELTA = 2
  end

  # Create OpenTelemetry options.
  #
  # @param url [String] URL for OpenTelemetry endpoint.
  # @param headers [Hash<String, String>, nil] Headers for OpenTelemetry endpoint.
  # @param metric_periodicity [Float, nil] How frequently metrics should be exported, unset uses internal default.
  # @param metric_temporality [MetricTemporality] How frequently metrics should be exported.
  # @param durations_as_seconds [Boolean] Whether to use float seconds instead of integer milliseconds for
  #   durations.
  def initialize(
    url:,
    headers: nil,
    metric_periodicity: nil,
    metric_temporality: MetricTemporality::CUMULATIVE,
    durations_as_seconds: false
  )
    super
  end

  # @!visibility private
  def _to_bridge
    # @type self: OpenTelemetryMetricsOptions
    Internal::Bridge::Runtime::OpenTelemetryMetricsOptions.new(
      url:,
      headers:,
      metric_periodicity:,
      metric_temporality_delta: case metric_temporality
                                when MetricTemporality::CUMULATIVE then false
                                when MetricTemporality::DELTA then true
                                else raise 'Unrecognized metric temporality'
                                end,
      durations_as_seconds:
    )
  end
end