Class: Temporalio::Runtime::MetricsOptions

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

#attach_service_nameBoolean

Returns Whether to put the service_name on every metric, default true.

Returns:

  • (Boolean)

    Whether to put the service_name on every metric, default true.



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/temporalio/runtime.rb', line 113

MetricsOptions = Struct.new(
  :opentelemetry,
  :prometheus,
  :attach_service_name,
  :global_tags,
  :metric_prefix,
  keyword_init: true
) do
  # @!visibility private
  def initialize(**kwargs)
    # @type var kwargs: untyped
    kwargs[:attach_service_name] = true unless kwargs.key?(:attach_service_name)
    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.



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/temporalio/runtime.rb', line 113

MetricsOptions = Struct.new(
  :opentelemetry,
  :prometheus,
  :attach_service_name,
  :global_tags,
  :metric_prefix,
  keyword_init: true
) do
  # @!visibility private
  def initialize(**kwargs)
    # @type var kwargs: untyped
    kwargs[:attach_service_name] = true unless kwargs.key?(:attach_service_name)
    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_.



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/temporalio/runtime.rb', line 113

MetricsOptions = Struct.new(
  :opentelemetry,
  :prometheus,
  :attach_service_name,
  :global_tags,
  :metric_prefix,
  keyword_init: true
) do
  # @!visibility private
  def initialize(**kwargs)
    # @type var kwargs: untyped
    kwargs[:attach_service_name] = true unless kwargs.key?(:attach_service_name)
    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:



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/temporalio/runtime.rb', line 113

MetricsOptions = Struct.new(
  :opentelemetry,
  :prometheus,
  :attach_service_name,
  :global_tags,
  :metric_prefix,
  keyword_init: true
) do
  # @!visibility private
  def initialize(**kwargs)
    # @type var kwargs: untyped
    kwargs[:attach_service_name] = true unless kwargs.key?(:attach_service_name)
    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.



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/temporalio/runtime.rb', line 113

MetricsOptions = Struct.new(
  :opentelemetry,
  :prometheus,
  :attach_service_name,
  :global_tags,
  :metric_prefix,
  keyword_init: true
) do
  # @!visibility private
  def initialize(**kwargs)
    # @type var kwargs: untyped
    kwargs[:attach_service_name] = true unless kwargs.key?(:attach_service_name)
    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