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, http: 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.

  • http (Boolean) (defaults to: false)

    True if the protocol is HTTP, false if gRPC (the default).



216
217
218
219
220
221
222
223
224
225
# File 'lib/temporalio/runtime.rb', line 216

def initialize(
  url:,
  headers: nil,
  metric_periodicity: nil,
  metric_temporality: MetricTemporality::CUMULATIVE,
  durations_as_seconds: false,
  http: 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.



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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/temporalio/runtime.rb', line 200

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.
  # @param http [Boolean] True if the protocol is HTTP, false if gRPC (the default).
  def initialize(
    url:,
    headers: nil,
    metric_periodicity: nil,
    metric_temporality: MetricTemporality::CUMULATIVE,
    durations_as_seconds: false,
    http: 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:,
      http:
    )
  end
end

#headersHash<String, String>?

Returns Headers for OpenTelemetry endpoint.

Returns:

  • (Hash<String, String>, nil)

    Headers for OpenTelemetry endpoint.



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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/temporalio/runtime.rb', line 200

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.
  # @param http [Boolean] True if the protocol is HTTP, false if gRPC (the default).
  def initialize(
    url:,
    headers: nil,
    metric_periodicity: nil,
    metric_temporality: MetricTemporality::CUMULATIVE,
    durations_as_seconds: false,
    http: 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:,
      http:
    )
  end
end

#httpBoolean

Returns True if the protocol is HTTP, false if gRPC (the default).

Returns:

  • (Boolean)

    True if the protocol is HTTP, false if gRPC (the default).



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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/temporalio/runtime.rb', line 200

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.
  # @param http [Boolean] True if the protocol is HTTP, false if gRPC (the default).
  def initialize(
    url:,
    headers: nil,
    metric_periodicity: nil,
    metric_temporality: MetricTemporality::CUMULATIVE,
    durations_as_seconds: false,
    http: 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:,
      http:
    )
  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.



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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/temporalio/runtime.rb', line 200

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.
  # @param http [Boolean] True if the protocol is HTTP, false if gRPC (the default).
  def initialize(
    url:,
    headers: nil,
    metric_periodicity: nil,
    metric_temporality: MetricTemporality::CUMULATIVE,
    durations_as_seconds: false,
    http: 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:,
      http:
    )
  end
end

#metric_temporalityMetricTemporality

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

Returns:



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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/temporalio/runtime.rb', line 200

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.
  # @param http [Boolean] True if the protocol is HTTP, false if gRPC (the default).
  def initialize(
    url:,
    headers: nil,
    metric_periodicity: nil,
    metric_temporality: MetricTemporality::CUMULATIVE,
    durations_as_seconds: false,
    http: 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:,
      http:
    )
  end
end

#urlString

Returns URL for OpenTelemetry endpoint.

Returns:

  • (String)

    URL for OpenTelemetry endpoint.



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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/temporalio/runtime.rb', line 200

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.
  # @param http [Boolean] True if the protocol is HTTP, false if gRPC (the default).
  def initialize(
    url:,
    headers: nil,
    metric_periodicity: nil,
    metric_temporality: MetricTemporality::CUMULATIVE,
    durations_as_seconds: false,
    http: 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:,
      http:
    )
  end
end