Class: Temporalio::Runtime::MetricsOptions
- Inherits:
-
Struct
- Object
- Struct
- 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, default
true
. -
#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 Attribute Details
#attach_service_name ⇒ Boolean
Returns 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_tags ⇒ Hash<String, String>?
Returns 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_prefix ⇒ String?
Returns 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 |
#opentelemetry ⇒ OpenTelemetryMetricsOptions?
Returns OpenTelemetry options if using OpenTelemetry. This is mutually exclusive with prometheus
.
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 |
#prometheus ⇒ PrometheusMetricsOptions?
Returns 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 |