Class: Temporalio::Runtime::MetricsOptions
- Inherits:
-
Object
- Object
- Temporalio::Runtime::MetricsOptions
- Defined in:
- lib/temporalio/runtime.rb
Overview
Metrics options for runtime telemetry. Either #opentelemetry or #prometheus required, but not both.
Instance Attribute Summary collapse
-
#attach_service_name ⇒ Boolean
Whether to put the service_name on every metric.
-
#buffer ⇒ MetricBuffer?
Metric buffer to send all metrics to.
-
#global_tags ⇒ Hash<String, String>?
Resource tags to be applied to all metrics.
-
#metric_prefix ⇒ String?
Prefix to put on every Temporal metric.
-
#opentelemetry ⇒ OpenTelemetryMetricsOptions?
OpenTelemetry options if using OpenTelemetry.
-
#prometheus ⇒ PrometheusMetricsOptions?
Prometheus options if using Prometheus.
Instance Method Summary collapse
-
#initialize(opentelemetry: nil, prometheus: nil, buffer: nil, attach_service_name: true, global_tags: nil, metric_prefix: nil) ⇒ MetricsOptions
constructor
Create metrics options.
Constructor Details
#initialize(opentelemetry: nil, prometheus: nil, buffer: nil, attach_service_name: true, global_tags: nil, metric_prefix: nil) ⇒ MetricsOptions
Create metrics options. Either ‘opentelemetry` or `prometheus` required, but not both.
146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/temporalio/runtime.rb', line 146 def initialize( opentelemetry: nil, prometheus: nil, buffer: nil, attach_service_name: true, global_tags: nil, metric_prefix: nil ) if [opentelemetry, prometheus, buffer].count { |v| !v.nil? } > 1 raise 'Can only have one of opentelemetry, prometheus, or buffer' end super end |
Instance Attribute Details
#attach_service_name ⇒ Boolean
Returns Whether to put the service_name on every metric.
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 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/temporalio/runtime.rb', line 134 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` and `buffer`. # @param prometheus [PrometheusMetricsOptions, nil] Prometheus options if using Prometheus. This is mutually # exclusive with `opentelemetry` and `buffer`. # @param buffer [MetricBuffer, nil] Metric buffer to send all metrics to. This is mutually exclusive with # `prometheus` and `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, buffer: nil, attach_service_name: true, global_tags: nil, metric_prefix: nil ) if [opentelemetry, prometheus, buffer].count { |v| !v.nil? } > 1 raise 'Can only have one of opentelemetry, prometheus, or buffer' end super end # @!visibility private def _to_bridge # @type self: MetricsOptions Internal::Bridge::Runtime::MetricsOptions.new( opentelemetry: opentelemetry&._to_bridge, prometheus: prometheus&._to_bridge, buffered_with_size: buffer&._buffer_size, attach_service_name:, global_tags:, metric_prefix: ) end end |
#buffer ⇒ MetricBuffer?
Returns Metric buffer to send all metrics to. This is mutually exclusive with ‘prometheus` and `opentelemetry`.
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 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/temporalio/runtime.rb', line 134 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` and `buffer`. # @param prometheus [PrometheusMetricsOptions, nil] Prometheus options if using Prometheus. This is mutually # exclusive with `opentelemetry` and `buffer`. # @param buffer [MetricBuffer, nil] Metric buffer to send all metrics to. This is mutually exclusive with # `prometheus` and `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, buffer: nil, attach_service_name: true, global_tags: nil, metric_prefix: nil ) if [opentelemetry, prometheus, buffer].count { |v| !v.nil? } > 1 raise 'Can only have one of opentelemetry, prometheus, or buffer' end super end # @!visibility private def _to_bridge # @type self: MetricsOptions Internal::Bridge::Runtime::MetricsOptions.new( opentelemetry: opentelemetry&._to_bridge, prometheus: prometheus&._to_bridge, buffered_with_size: buffer&._buffer_size, attach_service_name:, global_tags:, metric_prefix: ) end end |
#global_tags ⇒ Hash<String, String>?
Returns Resource tags to be applied to all metrics.
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 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/temporalio/runtime.rb', line 134 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` and `buffer`. # @param prometheus [PrometheusMetricsOptions, nil] Prometheus options if using Prometheus. This is mutually # exclusive with `opentelemetry` and `buffer`. # @param buffer [MetricBuffer, nil] Metric buffer to send all metrics to. This is mutually exclusive with # `prometheus` and `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, buffer: nil, attach_service_name: true, global_tags: nil, metric_prefix: nil ) if [opentelemetry, prometheus, buffer].count { |v| !v.nil? } > 1 raise 'Can only have one of opentelemetry, prometheus, or buffer' end super end # @!visibility private def _to_bridge # @type self: MetricsOptions Internal::Bridge::Runtime::MetricsOptions.new( opentelemetry: opentelemetry&._to_bridge, prometheus: prometheus&._to_bridge, buffered_with_size: buffer&._buffer_size, attach_service_name:, global_tags:, metric_prefix: ) end end |
#metric_prefix ⇒ String?
Returns Prefix to put on every Temporal metric. If unset, defaults to ‘temporal_`.
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 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/temporalio/runtime.rb', line 134 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` and `buffer`. # @param prometheus [PrometheusMetricsOptions, nil] Prometheus options if using Prometheus. This is mutually # exclusive with `opentelemetry` and `buffer`. # @param buffer [MetricBuffer, nil] Metric buffer to send all metrics to. This is mutually exclusive with # `prometheus` and `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, buffer: nil, attach_service_name: true, global_tags: nil, metric_prefix: nil ) if [opentelemetry, prometheus, buffer].count { |v| !v.nil? } > 1 raise 'Can only have one of opentelemetry, prometheus, or buffer' end super end # @!visibility private def _to_bridge # @type self: MetricsOptions Internal::Bridge::Runtime::MetricsOptions.new( opentelemetry: opentelemetry&._to_bridge, prometheus: prometheus&._to_bridge, buffered_with_size: buffer&._buffer_size, attach_service_name:, global_tags:, metric_prefix: ) end end |
#opentelemetry ⇒ OpenTelemetryMetricsOptions?
Returns OpenTelemetry options if using OpenTelemetry. This is mutually exclusive with ‘prometheus` and `buffer`.
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 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/temporalio/runtime.rb', line 134 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` and `buffer`. # @param prometheus [PrometheusMetricsOptions, nil] Prometheus options if using Prometheus. This is mutually # exclusive with `opentelemetry` and `buffer`. # @param buffer [MetricBuffer, nil] Metric buffer to send all metrics to. This is mutually exclusive with # `prometheus` and `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, buffer: nil, attach_service_name: true, global_tags: nil, metric_prefix: nil ) if [opentelemetry, prometheus, buffer].count { |v| !v.nil? } > 1 raise 'Can only have one of opentelemetry, prometheus, or buffer' end super end # @!visibility private def _to_bridge # @type self: MetricsOptions Internal::Bridge::Runtime::MetricsOptions.new( opentelemetry: opentelemetry&._to_bridge, prometheus: prometheus&._to_bridge, buffered_with_size: buffer&._buffer_size, attach_service_name:, global_tags:, metric_prefix: ) end end |
#prometheus ⇒ PrometheusMetricsOptions?
Returns Prometheus options if using Prometheus. This is mutually exclusive with ‘opentelemetry` and `buffer`.
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 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/temporalio/runtime.rb', line 134 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` and `buffer`. # @param prometheus [PrometheusMetricsOptions, nil] Prometheus options if using Prometheus. This is mutually # exclusive with `opentelemetry` and `buffer`. # @param buffer [MetricBuffer, nil] Metric buffer to send all metrics to. This is mutually exclusive with # `prometheus` and `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, buffer: nil, attach_service_name: true, global_tags: nil, metric_prefix: nil ) if [opentelemetry, prometheus, buffer].count { |v| !v.nil? } > 1 raise 'Can only have one of opentelemetry, prometheus, or buffer' end super end # @!visibility private def _to_bridge # @type self: MetricsOptions Internal::Bridge::Runtime::MetricsOptions.new( opentelemetry: opentelemetry&._to_bridge, prometheus: prometheus&._to_bridge, buffered_with_size: buffer&._buffer_size, attach_service_name:, global_tags:, metric_prefix: ) end end |