Class: Temporalio::Runtime::OpenTelemetryMetricsOptions
- Inherits:
-
Struct
- Object
- Struct
- Temporalio::Runtime::OpenTelemetryMetricsOptions
- Defined in:
- lib/temporalio/runtime.rb
Overview
Options for exporting metrics to OpenTelemetry.
Defined Under Namespace
Modules: MetricTemporality
Instance Attribute Summary collapse
-
#durations_as_seconds ⇒ Boolean
Whether to use float seconds instead of integer milliseconds for durations, default is
false
. -
#headers ⇒ Hash<String, String>?
Headers for OpenTelemetry endpoint.
-
#metric_periodicity ⇒ Float?
How frequently metrics should be exported, unset uses internal default.
-
#metric_temporality ⇒ MetricTemporality
How frequently metrics should be exported, default is MetricTemporality::CUMULATIVE.
-
#url ⇒ String
URL for OpenTelemetry endpoint.
Instance Attribute Details
#durations_as_seconds ⇒ Boolean
Returns Whether to use float seconds instead of integer milliseconds for durations, default is false
.
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/temporalio/runtime.rb', line 155 OpenTelemetryMetricsOptions = Struct.new( :url, :headers, :metric_periodicity, :metric_temporality, :durations_as_seconds, keyword_init: true ) do # OpenTelemetry metric temporality. module MetricTemporality # rubocop:disable Lint/ConstantDefinitionInBlock CUMULATIVE = 1 DELTA = 2 end # @!visibility private def initialize(**kwargs) # @type var kwargs: untyped kwargs[:metric_temporality] = MetricTemporality::CUMULATIVE unless kwargs.key?(:metric_temporality) kwargs[:durations_as_seconds] = false unless kwargs.key?(:durations_as_seconds) super end # @!visibility private def _to_bridge # @type self: OpenTelemetryMetricsOptions Internal::Bridge::Runtime::OpenTelemetryMetricsOptions.new( url:, headers:, metric_periodicity:, metric_temporality_delta: case metric_temporality when MetricTemporality::CUMULATIVE then false when MetricTemporality::DELTA then true else raise 'Unrecognized metric temporality' end, durations_as_seconds: ) end end |
#headers ⇒ Hash<String, String>?
Returns Headers for OpenTelemetry endpoint.
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/temporalio/runtime.rb', line 155 OpenTelemetryMetricsOptions = Struct.new( :url, :headers, :metric_periodicity, :metric_temporality, :durations_as_seconds, keyword_init: true ) do # OpenTelemetry metric temporality. module MetricTemporality # rubocop:disable Lint/ConstantDefinitionInBlock CUMULATIVE = 1 DELTA = 2 end # @!visibility private def initialize(**kwargs) # @type var kwargs: untyped kwargs[:metric_temporality] = MetricTemporality::CUMULATIVE unless kwargs.key?(:metric_temporality) kwargs[:durations_as_seconds] = false unless kwargs.key?(:durations_as_seconds) super end # @!visibility private def _to_bridge # @type self: OpenTelemetryMetricsOptions Internal::Bridge::Runtime::OpenTelemetryMetricsOptions.new( url:, headers:, metric_periodicity:, metric_temporality_delta: case metric_temporality when MetricTemporality::CUMULATIVE then false when MetricTemporality::DELTA then true else raise 'Unrecognized metric temporality' end, durations_as_seconds: ) end end |
#metric_periodicity ⇒ Float?
Returns How frequently metrics should be exported, unset uses internal default.
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/temporalio/runtime.rb', line 155 OpenTelemetryMetricsOptions = Struct.new( :url, :headers, :metric_periodicity, :metric_temporality, :durations_as_seconds, keyword_init: true ) do # OpenTelemetry metric temporality. module MetricTemporality # rubocop:disable Lint/ConstantDefinitionInBlock CUMULATIVE = 1 DELTA = 2 end # @!visibility private def initialize(**kwargs) # @type var kwargs: untyped kwargs[:metric_temporality] = MetricTemporality::CUMULATIVE unless kwargs.key?(:metric_temporality) kwargs[:durations_as_seconds] = false unless kwargs.key?(:durations_as_seconds) super end # @!visibility private def _to_bridge # @type self: OpenTelemetryMetricsOptions Internal::Bridge::Runtime::OpenTelemetryMetricsOptions.new( url:, headers:, metric_periodicity:, metric_temporality_delta: case metric_temporality when MetricTemporality::CUMULATIVE then false when MetricTemporality::DELTA then true else raise 'Unrecognized metric temporality' end, durations_as_seconds: ) end end |
#metric_temporality ⇒ MetricTemporality
Returns How frequently metrics should be exported, default is Temporalio::Runtime::OpenTelemetryMetricsOptions::MetricTemporality::CUMULATIVE.
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/temporalio/runtime.rb', line 155 OpenTelemetryMetricsOptions = Struct.new( :url, :headers, :metric_periodicity, :metric_temporality, :durations_as_seconds, keyword_init: true ) do # OpenTelemetry metric temporality. module MetricTemporality # rubocop:disable Lint/ConstantDefinitionInBlock CUMULATIVE = 1 DELTA = 2 end # @!visibility private def initialize(**kwargs) # @type var kwargs: untyped kwargs[:metric_temporality] = MetricTemporality::CUMULATIVE unless kwargs.key?(:metric_temporality) kwargs[:durations_as_seconds] = false unless kwargs.key?(:durations_as_seconds) super end # @!visibility private def _to_bridge # @type self: OpenTelemetryMetricsOptions Internal::Bridge::Runtime::OpenTelemetryMetricsOptions.new( url:, headers:, metric_periodicity:, metric_temporality_delta: case metric_temporality when MetricTemporality::CUMULATIVE then false when MetricTemporality::DELTA then true else raise 'Unrecognized metric temporality' end, durations_as_seconds: ) end end |
#url ⇒ String
Returns URL for OpenTelemetry endpoint.
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/temporalio/runtime.rb', line 155 OpenTelemetryMetricsOptions = Struct.new( :url, :headers, :metric_periodicity, :metric_temporality, :durations_as_seconds, keyword_init: true ) do # OpenTelemetry metric temporality. module MetricTemporality # rubocop:disable Lint/ConstantDefinitionInBlock CUMULATIVE = 1 DELTA = 2 end # @!visibility private def initialize(**kwargs) # @type var kwargs: untyped kwargs[:metric_temporality] = MetricTemporality::CUMULATIVE unless kwargs.key?(:metric_temporality) kwargs[:durations_as_seconds] = false unless kwargs.key?(:durations_as_seconds) super end # @!visibility private def _to_bridge # @type self: OpenTelemetryMetricsOptions Internal::Bridge::Runtime::OpenTelemetryMetricsOptions.new( url:, headers:, metric_periodicity:, metric_temporality_delta: case metric_temporality when MetricTemporality::CUMULATIVE then false when MetricTemporality::DELTA then true else raise 'Unrecognized metric temporality' end, durations_as_seconds: ) end end |