Class: Temporalio::Runtime::OpenTelemetryMetricsOptions

Inherits:
Struct
  • 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 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.



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/temporalio/runtime.rb', line 155

OpenTelemetryMetricsOptions = Struct.new(
  :url,
  :headers,
  :metric_periodicity,
  :metric_temporality,
  :durations_as_seconds,
  keyword_init: true
) do
  # OpenTelemetry metric temporality.
  module MetricTemporality # rubocop:disable Lint/ConstantDefinitionInBlock
    CUMULATIVE = 1
    DELTA = 2
  end

  # @!visibility private
  def initialize(**kwargs)
    # @type var kwargs: untyped
    kwargs[:metric_temporality] = MetricTemporality::CUMULATIVE unless kwargs.key?(:metric_temporality)
    kwargs[:durations_as_seconds] = false unless kwargs.key?(:durations_as_seconds)
    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.



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/temporalio/runtime.rb', line 155

OpenTelemetryMetricsOptions = Struct.new(
  :url,
  :headers,
  :metric_periodicity,
  :metric_temporality,
  :durations_as_seconds,
  keyword_init: true
) do
  # OpenTelemetry metric temporality.
  module MetricTemporality # rubocop:disable Lint/ConstantDefinitionInBlock
    CUMULATIVE = 1
    DELTA = 2
  end

  # @!visibility private
  def initialize(**kwargs)
    # @type var kwargs: untyped
    kwargs[:metric_temporality] = MetricTemporality::CUMULATIVE unless kwargs.key?(:metric_temporality)
    kwargs[:durations_as_seconds] = false unless kwargs.key?(:durations_as_seconds)
    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.



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/temporalio/runtime.rb', line 155

OpenTelemetryMetricsOptions = Struct.new(
  :url,
  :headers,
  :metric_periodicity,
  :metric_temporality,
  :durations_as_seconds,
  keyword_init: true
) do
  # OpenTelemetry metric temporality.
  module MetricTemporality # rubocop:disable Lint/ConstantDefinitionInBlock
    CUMULATIVE = 1
    DELTA = 2
  end

  # @!visibility private
  def initialize(**kwargs)
    # @type var kwargs: untyped
    kwargs[:metric_temporality] = MetricTemporality::CUMULATIVE unless kwargs.key?(:metric_temporality)
    kwargs[:durations_as_seconds] = false unless kwargs.key?(:durations_as_seconds)
    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:



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/temporalio/runtime.rb', line 155

OpenTelemetryMetricsOptions = Struct.new(
  :url,
  :headers,
  :metric_periodicity,
  :metric_temporality,
  :durations_as_seconds,
  keyword_init: true
) do
  # OpenTelemetry metric temporality.
  module MetricTemporality # rubocop:disable Lint/ConstantDefinitionInBlock
    CUMULATIVE = 1
    DELTA = 2
  end

  # @!visibility private
  def initialize(**kwargs)
    # @type var kwargs: untyped
    kwargs[:metric_temporality] = MetricTemporality::CUMULATIVE unless kwargs.key?(:metric_temporality)
    kwargs[:durations_as_seconds] = false unless kwargs.key?(:durations_as_seconds)
    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.



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/temporalio/runtime.rb', line 155

OpenTelemetryMetricsOptions = Struct.new(
  :url,
  :headers,
  :metric_periodicity,
  :metric_temporality,
  :durations_as_seconds,
  keyword_init: true
) do
  # OpenTelemetry metric temporality.
  module MetricTemporality # rubocop:disable Lint/ConstantDefinitionInBlock
    CUMULATIVE = 1
    DELTA = 2
  end

  # @!visibility private
  def initialize(**kwargs)
    # @type var kwargs: untyped
    kwargs[:metric_temporality] = MetricTemporality::CUMULATIVE unless kwargs.key?(:metric_temporality)
    kwargs[:durations_as_seconds] = false unless kwargs.key?(:durations_as_seconds)
    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