Class: Temporalio::Runtime::MetricsOptions

Inherits:
Data
  • Object
show all
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

Instance Method Summary collapse

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_nameBoolean



135
136
137
# File 'lib/temporalio/runtime.rb', line 135

def attach_service_name
  @attach_service_name
end

#bufferMetricBuffer?



135
136
137
# File 'lib/temporalio/runtime.rb', line 135

def buffer
  @buffer
end

#global_tagsHash<String, String>?



135
136
137
# File 'lib/temporalio/runtime.rb', line 135

def global_tags
  @global_tags
end

#metric_prefixString?



135
136
137
# File 'lib/temporalio/runtime.rb', line 135

def metric_prefix
  @metric_prefix
end

#opentelemetryOpenTelemetryMetricsOptions?



135
136
137
# File 'lib/temporalio/runtime.rb', line 135

def opentelemetry
  @opentelemetry
end

#prometheusPrometheusMetricsOptions?



135
136
137
# File 'lib/temporalio/runtime.rb', line 135

def prometheus
  @prometheus
end