Class: Temporalio::Runtime::MetricsOptions
- Inherits:
-
Data
- Object
- Data
- Temporalio::Runtime::MetricsOptions
- Defined in:
- lib/temporalio/runtime.rb,
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.
147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/temporalio/runtime.rb', line 147 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.
135 136 137 |
# File 'lib/temporalio/runtime.rb', line 135 def attach_service_name @attach_service_name end |
#buffer ⇒ MetricBuffer?
Returns Metric buffer to send all metrics to. This is mutually exclusive with ‘prometheus` and `opentelemetry`.
135 136 137 |
# File 'lib/temporalio/runtime.rb', line 135 def buffer @buffer end |
#global_tags ⇒ Hash<String, String>?
Returns Resource tags to be applied to all metrics.
135 136 137 |
# File 'lib/temporalio/runtime.rb', line 135 def end |
#metric_prefix ⇒ String?
Returns Prefix to put on every Temporal metric. If unset, defaults to ‘temporal_`.
135 136 137 |
# File 'lib/temporalio/runtime.rb', line 135 def metric_prefix @metric_prefix end |
#opentelemetry ⇒ OpenTelemetryMetricsOptions?
Returns OpenTelemetry options if using OpenTelemetry. This is mutually exclusive with ‘prometheus` and `buffer`.
135 136 137 |
# File 'lib/temporalio/runtime.rb', line 135 def opentelemetry @opentelemetry end |
#prometheus ⇒ PrometheusMetricsOptions?
Returns Prometheus options if using Prometheus. This is mutually exclusive with ‘opentelemetry` and `buffer`.
135 136 137 |
# File 'lib/temporalio/runtime.rb', line 135 def prometheus @prometheus end |