Class: Temporalio::Runtime::OpenTelemetryMetricsOptions

Inherits:
Data
  • Object
show all
Defined in:
lib/temporalio/runtime.rb,
lib/temporalio/runtime.rb

Overview

Options for exporting metrics to OpenTelemetry.

Defined Under Namespace

Modules: MetricTemporality

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url:, headers: nil, metric_periodicity: nil, metric_temporality: MetricTemporality::CUMULATIVE, durations_as_seconds: false, http: false, histogram_bucket_overrides: nil) ⇒ OpenTelemetryMetricsOptions

Create OpenTelemetry options.

Parameters:

  • url (String)

    URL for OpenTelemetry endpoint.

  • headers (Hash<String, String>, nil) (defaults to: nil)

    Headers for OpenTelemetry endpoint.

  • metric_periodicity (Float, nil) (defaults to: nil)

    How frequently metrics should be exported, unset uses internal default.

  • metric_temporality (MetricTemporality) (defaults to: MetricTemporality::CUMULATIVE)

    How frequently metrics should be exported.

  • durations_as_seconds (Boolean) (defaults to: false)

    Whether to use float seconds instead of integer milliseconds for durations.

  • http (Boolean) (defaults to: false)

    True if the protocol is HTTP, false if gRPC (the default).

  • histogram_bucket_overrides (Hash<String, Array<Numeric>>, nil) (defaults to: nil)

    Override default histogram buckets. Key of the hash it the metric name, value is an array of floats for the set of buckets.



236
237
238
239
240
241
242
243
244
245
246
# File 'lib/temporalio/runtime.rb', line 236

def initialize(
  url:,
  headers: nil,
  metric_periodicity: nil,
  metric_temporality: MetricTemporality::CUMULATIVE,
  durations_as_seconds: false,
  http: false,
  histogram_bucket_overrides: nil
)
  super
end

Instance Attribute Details

#durations_as_secondsBoolean

Returns Whether to use float seconds instead of integer milliseconds for durations, default is false.

Returns:

  • (Boolean)

    Whether to use float seconds instead of integer milliseconds for durations, default is false.



218
219
220
# File 'lib/temporalio/runtime.rb', line 218

def durations_as_seconds
  @durations_as_seconds
end

#headersHash<String, String>?

Returns Headers for OpenTelemetry endpoint.

Returns:

  • (Hash<String, String>, nil)

    Headers for OpenTelemetry endpoint.



218
219
220
# File 'lib/temporalio/runtime.rb', line 218

def headers
  @headers
end

#histogram_bucket_overridesHash<String, Array<Numeric>>?

Returns Override default histogram buckets. Key of the hash it the metric name, value is an array of floats for the set of buckets.

Returns:

  • (Hash<String, Array<Numeric>>, nil)

    Override default histogram buckets. Key of the hash it the metric name, value is an array of floats for the set of buckets.



218
219
220
# File 'lib/temporalio/runtime.rb', line 218

def histogram_bucket_overrides
  @histogram_bucket_overrides
end

#httpBoolean

Returns True if the protocol is HTTP, false if gRPC (the default).

Returns:

  • (Boolean)

    True if the protocol is HTTP, false if gRPC (the default).



218
219
220
# File 'lib/temporalio/runtime.rb', line 218

def http
  @http
end

#metric_periodicityFloat?

Returns How frequently metrics should be exported, unset uses internal default.

Returns:

  • (Float, nil)

    How frequently metrics should be exported, unset uses internal default.



218
219
220
# File 'lib/temporalio/runtime.rb', line 218

def metric_periodicity
  @metric_periodicity
end

#metric_temporalityMetricTemporality

Returns How frequently metrics should be exported, default is Temporalio::Runtime::OpenTelemetryMetricsOptions::MetricTemporality::CUMULATIVE.

Returns:



218
219
220
# File 'lib/temporalio/runtime.rb', line 218

def metric_temporality
  @metric_temporality
end

#urlString

Returns URL for OpenTelemetry endpoint.

Returns:

  • (String)

    URL for OpenTelemetry endpoint.



218
219
220
# File 'lib/temporalio/runtime.rb', line 218

def url
  @url
end