Class: Temporalio::Runtime::MetricsOptions

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

Overview

Metrics options for runtime telemetry. Either #opentelemetry or #prometheus required, but not both.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opentelemetry: nil, prometheus: nil, attach_service_name: true, global_tags: nil, metric_prefix: nil) ⇒ MetricsOptions

Create metrics options. Either ‘opentelemetry` or `prometheus` required, but not both.

Parameters:

  • opentelemetry (OpenTelemetryMetricsOptions, nil) (defaults to: nil)

    OpenTelemetry options if using OpenTelemetry. This is mutually exclusive with ‘prometheus`.

  • prometheus (PrometheusMetricsOptions, nil) (defaults to: nil)

    Prometheus options if using Prometheus. This is mutually exclusive with ‘opentelemetry`.

  • attach_service_name (Boolean) (defaults to: true)

    Whether to put the service_name on every metric.

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

    Resource tags to be applied to all metrics.

  • metric_prefix (String, nil) (defaults to: nil)

    Prefix to put on every Temporal metric. If unset, defaults to ‘temporal_`.



139
140
141
142
143
144
145
146
147
# File 'lib/temporalio/runtime.rb', line 139

def initialize(
  opentelemetry: nil,
  prometheus: nil,
  attach_service_name: true,
  global_tags: nil,
  metric_prefix: nil
)
  super
end

Instance Attribute Details

#attach_service_nameBoolean

Returns Whether to put the service_name on every metric.

Returns:

  • (Boolean)

    Whether to put the service_name on every metric.



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/temporalio/runtime.rb', line 129

class MetricsOptions
  # Create metrics options. Either `opentelemetry` or `prometheus` required, but not both.
  #
  # @param opentelemetry [OpenTelemetryMetricsOptions, nil] OpenTelemetry options if using OpenTelemetry. This is
  #   mutually exclusive with `prometheus`.
  # @param prometheus [PrometheusMetricsOptions, nil] Prometheus options if using Prometheus. This is mutually
  #   exclusive with `opentelemetry`.
  # @param attach_service_name [Boolean] Whether to put the service_name on every metric.
  # @param global_tags [Hash<String, String>, nil] Resource tags to be applied to all metrics.
  # @param metric_prefix [String, nil] Prefix to put on every Temporal metric. If unset, defaults to `temporal_`.
  def initialize(
    opentelemetry: nil,
    prometheus: nil,
    attach_service_name: true,
    global_tags: nil,
    metric_prefix: nil
  )
    super
  end

  # @!visibility private
  def _to_bridge
    # @type self: MetricsOptions
    Internal::Bridge::Runtime::MetricsOptions.new(
      opentelemetry: opentelemetry&._to_bridge,
      prometheus: prometheus&._to_bridge,
      attach_service_name:,
      global_tags:,
      metric_prefix:
    )
  end
end

#global_tagsHash<String, String>?

Returns Resource tags to be applied to all metrics.

Returns:

  • (Hash<String, String>, nil)

    Resource tags to be applied to all metrics.



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/temporalio/runtime.rb', line 129

class MetricsOptions
  # Create metrics options. Either `opentelemetry` or `prometheus` required, but not both.
  #
  # @param opentelemetry [OpenTelemetryMetricsOptions, nil] OpenTelemetry options if using OpenTelemetry. This is
  #   mutually exclusive with `prometheus`.
  # @param prometheus [PrometheusMetricsOptions, nil] Prometheus options if using Prometheus. This is mutually
  #   exclusive with `opentelemetry`.
  # @param attach_service_name [Boolean] Whether to put the service_name on every metric.
  # @param global_tags [Hash<String, String>, nil] Resource tags to be applied to all metrics.
  # @param metric_prefix [String, nil] Prefix to put on every Temporal metric. If unset, defaults to `temporal_`.
  def initialize(
    opentelemetry: nil,
    prometheus: nil,
    attach_service_name: true,
    global_tags: nil,
    metric_prefix: nil
  )
    super
  end

  # @!visibility private
  def _to_bridge
    # @type self: MetricsOptions
    Internal::Bridge::Runtime::MetricsOptions.new(
      opentelemetry: opentelemetry&._to_bridge,
      prometheus: prometheus&._to_bridge,
      attach_service_name:,
      global_tags:,
      metric_prefix:
    )
  end
end

#metric_prefixString?

Returns Prefix to put on every Temporal metric. If unset, defaults to ‘temporal_`.

Returns:

  • (String, nil)

    Prefix to put on every Temporal metric. If unset, defaults to ‘temporal_`.



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/temporalio/runtime.rb', line 129

class MetricsOptions
  # Create metrics options. Either `opentelemetry` or `prometheus` required, but not both.
  #
  # @param opentelemetry [OpenTelemetryMetricsOptions, nil] OpenTelemetry options if using OpenTelemetry. This is
  #   mutually exclusive with `prometheus`.
  # @param prometheus [PrometheusMetricsOptions, nil] Prometheus options if using Prometheus. This is mutually
  #   exclusive with `opentelemetry`.
  # @param attach_service_name [Boolean] Whether to put the service_name on every metric.
  # @param global_tags [Hash<String, String>, nil] Resource tags to be applied to all metrics.
  # @param metric_prefix [String, nil] Prefix to put on every Temporal metric. If unset, defaults to `temporal_`.
  def initialize(
    opentelemetry: nil,
    prometheus: nil,
    attach_service_name: true,
    global_tags: nil,
    metric_prefix: nil
  )
    super
  end

  # @!visibility private
  def _to_bridge
    # @type self: MetricsOptions
    Internal::Bridge::Runtime::MetricsOptions.new(
      opentelemetry: opentelemetry&._to_bridge,
      prometheus: prometheus&._to_bridge,
      attach_service_name:,
      global_tags:,
      metric_prefix:
    )
  end
end

#opentelemetryOpenTelemetryMetricsOptions?

Returns OpenTelemetry options if using OpenTelemetry. This is mutually exclusive with prometheus.

Returns:



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/temporalio/runtime.rb', line 129

class MetricsOptions
  # Create metrics options. Either `opentelemetry` or `prometheus` required, but not both.
  #
  # @param opentelemetry [OpenTelemetryMetricsOptions, nil] OpenTelemetry options if using OpenTelemetry. This is
  #   mutually exclusive with `prometheus`.
  # @param prometheus [PrometheusMetricsOptions, nil] Prometheus options if using Prometheus. This is mutually
  #   exclusive with `opentelemetry`.
  # @param attach_service_name [Boolean] Whether to put the service_name on every metric.
  # @param global_tags [Hash<String, String>, nil] Resource tags to be applied to all metrics.
  # @param metric_prefix [String, nil] Prefix to put on every Temporal metric. If unset, defaults to `temporal_`.
  def initialize(
    opentelemetry: nil,
    prometheus: nil,
    attach_service_name: true,
    global_tags: nil,
    metric_prefix: nil
  )
    super
  end

  # @!visibility private
  def _to_bridge
    # @type self: MetricsOptions
    Internal::Bridge::Runtime::MetricsOptions.new(
      opentelemetry: opentelemetry&._to_bridge,
      prometheus: prometheus&._to_bridge,
      attach_service_name:,
      global_tags:,
      metric_prefix:
    )
  end
end

#prometheusPrometheusMetricsOptions?

Returns Prometheus options if using Prometheus. This is mutually exclusive with opentelemetry.

Returns:

  • (PrometheusMetricsOptions, nil)

    Prometheus options if using Prometheus. This is mutually exclusive with opentelemetry.



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/temporalio/runtime.rb', line 129

class MetricsOptions
  # Create metrics options. Either `opentelemetry` or `prometheus` required, but not both.
  #
  # @param opentelemetry [OpenTelemetryMetricsOptions, nil] OpenTelemetry options if using OpenTelemetry. This is
  #   mutually exclusive with `prometheus`.
  # @param prometheus [PrometheusMetricsOptions, nil] Prometheus options if using Prometheus. This is mutually
  #   exclusive with `opentelemetry`.
  # @param attach_service_name [Boolean] Whether to put the service_name on every metric.
  # @param global_tags [Hash<String, String>, nil] Resource tags to be applied to all metrics.
  # @param metric_prefix [String, nil] Prefix to put on every Temporal metric. If unset, defaults to `temporal_`.
  def initialize(
    opentelemetry: nil,
    prometheus: nil,
    attach_service_name: true,
    global_tags: nil,
    metric_prefix: nil
  )
    super
  end

  # @!visibility private
  def _to_bridge
    # @type self: MetricsOptions
    Internal::Bridge::Runtime::MetricsOptions.new(
      opentelemetry: opentelemetry&._to_bridge,
      prometheus: prometheus&._to_bridge,
      attach_service_name:,
      global_tags:,
      metric_prefix:
    )
  end
end