Class: OpenTelemetry::Exporter::OTLP::Metrics::MetricsExporter
- Inherits:
-
SDK::Metrics::Export::MetricReader
- Object
- SDK::Metrics::Export::MetricReader
- OpenTelemetry::Exporter::OTLP::Metrics::MetricsExporter
- Includes:
- Util
- Defined in:
- lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb
Overview
An OpenTelemetry metrics exporter that sends metrics over HTTP as Protobuf encoded OTLP ExportMetricsServiceRequest.
Constant Summary
Constants included from Util
Util::DEFAULT_USER_AGENT, Util::ERROR_MESSAGE_INVALID_HEADERS, Util::KEEP_ALIVE_TIMEOUT, Util::RETRY_COUNT
Instance Attribute Summary collapse
-
#metric_snapshots ⇒ Object
readonly
Returns the value of attribute metric_snapshots.
Class Method Summary collapse
-
.ssl_verify_mode ⇒ Object
rubocop:disable Lint/DuplicateBranch Returns the SSL verify mode configured via environment variables.
Instance Method Summary collapse
-
#as_otlp_aggregation_temporality(type) ⇒ Object
Converts an SDK aggregation temporality symbol to its OTLP proto enum value.
-
#as_otlp_exemplar(exemplar) ⇒ Object
Converts a single SDK exemplar to its OTLP proto representation.
-
#as_otlp_exemplars(exemplars) ⇒ Object
Converts a list of SDK exemplars to their OTLP proto representation.
-
#as_otlp_metrics(metrics) ⇒ Object
metrics_pb has following type of data: :gauge, :sum, :histogram, :exponential_histogram, :summary current metric sdk only implements instrument: :counter -> :sum, :histogram -> :histogram, :gauge -> :gauge.
-
#encode(metrics_data) ⇒ Object
Encodes metrics_data into a serialized ExportMetricsServiceRequest.
-
#explicit_histogram_data_point(hdp) ⇒ Object
Converts a HistogramDataPoint to its OTLP proto representation.
-
#exponential_histogram_data_point(ehdp) ⇒ Object
Converts an ExponentialHistogramDataPoint to its OTLP proto representation.
-
#export(metrics, timeout: nil) ⇒ Object
metrics Array.
-
#force_flush(timeout: nil) ⇒ Object
No-op: there is nothing to flush for this exporter.
-
#histogram_data_point(metrics) ⇒ Object
Builds an OTLP Metric for either histogram or exponential histogram data points.
-
#initialize(endpoint: nil, certificate_file: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE', 'OTEL_EXPORTER_OTLP_CERTIFICATE'), client_certificate_file: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE', 'OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE'), client_key_file: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY', 'OTEL_EXPORTER_OTLP_CLIENT_KEY'), ssl_verify_mode: MetricsExporter.ssl_verify_mode, headers: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_METRICS_HEADERS', 'OTEL_EXPORTER_OTLP_HEADERS', default: {}), compression: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_METRICS_COMPRESSION', 'OTEL_EXPORTER_OTLP_COMPRESSION', default: 'gzip'), timeout: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_METRICS_TIMEOUT', 'OTEL_EXPORTER_OTLP_TIMEOUT', default: 10), aggregation_cardinality_limit: nil) ⇒ MetricsExporter
constructor
rubocop:enable Lint/DuplicateBranch.
-
#number_data_point(ndp) ⇒ Object
Converts a NumberDataPoint to its OTLP proto representation.
-
#pull ⇒ Object
consolidate the metrics data into the form of MetricData.
-
#reset ⇒ Object
may not need this.
-
#send_bytes(bytes, timeout:) ⇒ Object
Sends the encoded request bytes to the configured OTLP endpoint.
-
#shutdown(timeout: nil) ⇒ Object
Marks this exporter as shut down so subsequent exports fail.
Methods included from Util
#around_request, #as_otlp_any_value, #as_otlp_key_value, #backoff?, #handle_redirect, #http_connection, #log_status, #parse_headers, #prepare_headers
Constructor Details
#initialize(endpoint: nil, certificate_file: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE', 'OTEL_EXPORTER_OTLP_CERTIFICATE'), client_certificate_file: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE', 'OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE'), client_key_file: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY', 'OTEL_EXPORTER_OTLP_CLIENT_KEY'), ssl_verify_mode: MetricsExporter.ssl_verify_mode, headers: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_METRICS_HEADERS', 'OTEL_EXPORTER_OTLP_HEADERS', default: {}), compression: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_METRICS_COMPRESSION', 'OTEL_EXPORTER_OTLP_COMPRESSION', default: 'gzip'), timeout: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_METRICS_TIMEOUT', 'OTEL_EXPORTER_OTLP_TIMEOUT', default: 10), aggregation_cardinality_limit: nil) ⇒ MetricsExporter
rubocop:enable Lint/DuplicateBranch
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb', line 52 def initialize(endpoint: nil, certificate_file: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE', 'OTEL_EXPORTER_OTLP_CERTIFICATE'), client_certificate_file: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE', 'OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE'), client_key_file: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY', 'OTEL_EXPORTER_OTLP_CLIENT_KEY'), ssl_verify_mode: MetricsExporter.ssl_verify_mode, headers: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_METRICS_HEADERS', 'OTEL_EXPORTER_OTLP_HEADERS', default: {}), compression: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_METRICS_COMPRESSION', 'OTEL_EXPORTER_OTLP_COMPRESSION', default: 'gzip'), timeout: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_OTLP_METRICS_TIMEOUT', 'OTEL_EXPORTER_OTLP_TIMEOUT', default: 10), aggregation_cardinality_limit: nil) raise ArgumentError, "unsupported compression key #{compression}" unless compression.nil? || %w[gzip none].include?(compression) # create the MetricStore object super(aggregation_cardinality_limit: aggregation_cardinality_limit) @uri = OpenTelemetry::Exporter::OTLP::Common::Utilities.build_uri(endpoint, 'v1/metrics', 'OTEL_EXPORTER_OTLP_METRICS_ENDPOINT', 'OTEL_EXPORTER_OTLP_ENDPOINT', 'http://localhost:4318/') @http = http_connection(@uri, ssl_verify_mode, certificate_file, client_certificate_file, client_key_file) @path = @uri.path @headers = prepare_headers(headers) @timeout = timeout.to_f @compression = compression @mutex = Mutex.new @shutdown = false end |
Instance Attribute Details
#metric_snapshots ⇒ Object (readonly)
Returns the value of attribute metric_snapshots.
33 34 35 |
# File 'lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb', line 33 def metric_snapshots @metric_snapshots end |
Class Method Details
.ssl_verify_mode ⇒ Object
rubocop:disable Lint/DuplicateBranch Returns the SSL verify mode configured via environment variables.
41 42 43 44 45 46 47 48 49 |
# File 'lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb', line 41 def self.ssl_verify_mode if ENV.key?('OTEL_RUBY_EXPORTER_OTLP_SSL_VERIFY_PEER') OpenSSL::SSL::VERIFY_PEER elsif ENV.key?('OTEL_RUBY_EXPORTER_OTLP_SSL_VERIFY_NONE') OpenSSL::SSL::VERIFY_NONE else OpenSSL::SSL::VERIFY_PEER end end |
Instance Method Details
#as_otlp_aggregation_temporality(type) ⇒ Object
Converts an SDK aggregation temporality symbol to its OTLP proto enum value.
261 262 263 264 265 266 267 |
# File 'lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb', line 261 def as_otlp_aggregation_temporality(type) case type when :delta then Opentelemetry::Proto::Metrics::V1::AggregationTemporality::AGGREGATION_TEMPORALITY_DELTA when :cumulative then Opentelemetry::Proto::Metrics::V1::AggregationTemporality::AGGREGATION_TEMPORALITY_CUMULATIVE else Opentelemetry::Proto::Metrics::V1::AggregationTemporality::AGGREGATION_TEMPORALITY_UNSPECIFIED end end |
#as_otlp_exemplar(exemplar) ⇒ Object
Converts a single SDK exemplar to its OTLP proto representation.
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb', line 368 def as_otlp_exemplar(exemplar) args = { time_unix_nano: exemplar.time_unix_nano, span_id: exemplar.span_id, trace_id: exemplar.trace_id } # Add filtered_attributes if present args[:filtered_attributes] = exemplar.filtered_attributes.map { |k, v| as_otlp_key_value(k, v) } if exemplar.filtered_attributes # Set value based on type if exemplar.value.is_a?(Float) args[:as_double] = exemplar.value else args[:as_int] = exemplar.value end Opentelemetry::Proto::Metrics::V1::Exemplar.new(**args) end |
#as_otlp_exemplars(exemplars) ⇒ Object
Converts a list of SDK exemplars to their OTLP proto representation.
363 364 365 |
# File 'lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb', line 363 def as_otlp_exemplars(exemplars) exemplars&.map { |ex| as_otlp_exemplar(ex) } || [] end |
#as_otlp_metrics(metrics) ⇒ Object
metrics_pb has following type of data: :gauge, :sum, :histogram, :exponential_histogram, :summary current metric sdk only implements instrument: :counter -> :sum, :histogram -> :histogram, :gauge -> :gauge
metrics [MetricData]
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb', line 226 def as_otlp_metrics(metrics) case metrics.instrument_kind when :observable_gauge, :gauge Opentelemetry::Proto::Metrics::V1::Metric.new( name: metrics.name, description: metrics.description, unit: metrics.unit, gauge: Opentelemetry::Proto::Metrics::V1::Gauge.new( data_points: metrics.data_points.map do |ndp| number_data_point(ndp) end ) ) when :counter, :up_down_counter, :observable_counter, :observable_up_down_counter Opentelemetry::Proto::Metrics::V1::Metric.new( name: metrics.name, description: metrics.description, unit: metrics.unit, sum: Opentelemetry::Proto::Metrics::V1::Sum.new( aggregation_temporality: as_otlp_aggregation_temporality(metrics.aggregation_temporality), data_points: metrics.data_points.map do |ndp| number_data_point(ndp) end, is_monotonic: metrics.is_monotonic ) ) when :histogram histogram_data_point(metrics) end end |
#encode(metrics_data) ⇒ Object
Encodes metrics_data into a serialized ExportMetricsServiceRequest.
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb', line 192 def encode(metrics_data) Opentelemetry::Proto::Collector::Metrics::V1::ExportMetricsServiceRequest.encode( Opentelemetry::Proto::Collector::Metrics::V1::ExportMetricsServiceRequest.new( resource_metrics: metrics_data .group_by(&:resource) .map do |resource, scope_metrics| Opentelemetry::Proto::Metrics::V1::ResourceMetrics.new( resource: Opentelemetry::Proto::Resource::V1::Resource.new( attributes: resource.attribute_enumerator.map { |key, value| as_otlp_key_value(key, value) } ), scope_metrics: scope_metrics .group_by(&:instrumentation_scope) .map do |instrumentation_scope, metrics| Opentelemetry::Proto::Metrics::V1::ScopeMetrics.new( scope: Opentelemetry::Proto::Common::V1::InstrumentationScope.new( name: instrumentation_scope.name, version: instrumentation_scope.version ), metrics: metrics.map { |sd| as_otlp_metrics(sd) } ) end ) end ) ) rescue StandardError => e OpenTelemetry.handle_error(exception: e, message: 'unexpected error in OTLP::MetricsExporter#encode') nil end |
#explicit_histogram_data_point(hdp) ⇒ Object
Converts a HistogramDataPoint to its OTLP proto representation.
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 |
# File 'lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb', line 301 def explicit_histogram_data_point(hdp) Opentelemetry::Proto::Metrics::V1::HistogramDataPoint.new( attributes: hdp.attributes.map { |k, v| as_otlp_key_value(k, v) }, start_time_unix_nano: hdp.start_time_unix_nano, time_unix_nano: hdp.time_unix_nano, count: hdp.count, sum: hdp.sum, bucket_counts: hdp.bucket_counts, explicit_bounds: hdp.explicit_bounds, exemplars: as_otlp_exemplars(hdp.exemplars), min: hdp.min, max: hdp.max, flags: hdp.flags ) end |
#exponential_histogram_data_point(ehdp) ⇒ Object
Converts an ExponentialHistogramDataPoint to its OTLP proto representation.
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 |
# File 'lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb', line 318 def exponential_histogram_data_point(ehdp) Opentelemetry::Proto::Metrics::V1::ExponentialHistogramDataPoint.new( attributes: ehdp.attributes.map { |k, v| as_otlp_key_value(k, v) }, start_time_unix_nano: ehdp.start_time_unix_nano, time_unix_nano: ehdp.time_unix_nano, count: ehdp.count, sum: ehdp.sum, scale: ehdp.scale, zero_count: ehdp.zero_count, positive: Opentelemetry::Proto::Metrics::V1::ExponentialHistogramDataPoint::Buckets.new( offset: ehdp.positive.offset, bucket_counts: ehdp.positive.counts ), negative: Opentelemetry::Proto::Metrics::V1::ExponentialHistogramDataPoint::Buckets.new( offset: ehdp.negative.offset, bucket_counts: ehdp.negative.counts ), flags: ehdp.flags, exemplars: as_otlp_exemplars(ehdp.exemplars), min: ehdp.min, max: ehdp.max, zero_threshold: ehdp.zero_threshold ) end |
#export(metrics, timeout: nil) ⇒ Object
metrics Array
85 86 87 88 89 90 91 92 93 94 |
# File 'lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb', line 85 def export(metrics, timeout: nil) if @shutdown OpenTelemetry.logger.warn('Exporter already shutdown, ignoring export request') return FAILURE end @mutex.synchronize do send_bytes(encode(metrics), timeout: timeout) end end |
#force_flush(timeout: nil) ⇒ Object
No-op: there is nothing to flush for this exporter.
394 395 396 |
# File 'lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb', line 394 def force_flush(timeout: nil) SUCCESS end |
#histogram_data_point(metrics) ⇒ Object
Builds an OTLP Metric for either histogram or exponential histogram data points.
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 |
# File 'lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb', line 270 def histogram_data_point(metrics) return if metrics.data_points.empty? if metrics.data_points.first.instance_of?(OpenTelemetry::SDK::Metrics::Aggregation::ExponentialHistogramDataPoint) Opentelemetry::Proto::Metrics::V1::Metric.new( name: metrics.name, description: metrics.description, unit: metrics.unit, exponential_histogram: Opentelemetry::Proto::Metrics::V1::ExponentialHistogram.new( aggregation_temporality: as_otlp_aggregation_temporality(metrics.aggregation_temporality), data_points: metrics.data_points.map do |ehdp| exponential_histogram_data_point(ehdp) end ) ) elsif metrics.data_points.first.instance_of?(OpenTelemetry::SDK::Metrics::Aggregation::HistogramDataPoint) Opentelemetry::Proto::Metrics::V1::Metric.new( name: metrics.name, description: metrics.description, unit: metrics.unit, histogram: Opentelemetry::Proto::Metrics::V1::Histogram.new( aggregation_temporality: as_otlp_aggregation_temporality(metrics.aggregation_temporality), data_points: metrics.data_points.map do |hdp| explicit_histogram_data_point(hdp) end ) ) end end |
#number_data_point(ndp) ⇒ Object
Converts a NumberDataPoint to its OTLP proto representation.
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 |
# File 'lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb', line 344 def number_data_point(ndp) args = { attributes: ndp.attributes.map { |k, v| as_otlp_key_value(k, v) }, start_time_unix_nano: ndp.start_time_unix_nano, time_unix_nano: ndp.time_unix_nano, exemplars: as_otlp_exemplars(ndp.exemplars), flags: ndp.flags } if ndp.value.is_a?(Float) args[:as_double] = ndp.value else args[:as_int] = ndp.value end Opentelemetry::Proto::Metrics::V1::NumberDataPoint.new(**args) end |
#pull ⇒ Object
consolidate the metrics data into the form of MetricData
return MetricData
80 81 82 |
# File 'lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb', line 80 def pull export(collect) end |
#reset ⇒ Object
may not need this
389 390 391 |
# File 'lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb', line 389 def reset SUCCESS end |
#send_bytes(bytes, timeout:) ⇒ Object
Sends the encoded request bytes to the configured OTLP endpoint.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 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 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 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 |
# File 'lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb', line 97 def send_bytes(bytes, timeout:) return FAILURE if bytes.nil? request = Net::HTTP::Post.new(@path) if @compression == 'gzip' request.add_field('Content-Encoding', 'gzip') body = Zlib.gzip(bytes) else body = bytes end request.body = body request.add_field('Content-Type', 'application/x-protobuf') @headers.each { |key, value| request.add_field(key, value) } retry_count = 0 timeout ||= @timeout start_time = OpenTelemetry::Common::Utilities. around_request do remaining_timeout = OpenTelemetry::Common::Utilities.maybe_timeout(timeout, start_time) return FAILURE if remaining_timeout.zero? @http.open_timeout = remaining_timeout @http.read_timeout = remaining_timeout @http.write_timeout = remaining_timeout @http.start unless @http.started? response = @http.request(request) case response when Net::HTTPSuccess response.body # Read and discard body SUCCESS when Net::HTTPServiceUnavailable, Net::HTTPTooManyRequests response.body # Read and discard body redo if backoff?(retry_after: response['Retry-After'], retry_count: retry_count += 1, reason: response.code) OpenTelemetry.logger.warn('Net::HTTPServiceUnavailable/Net::HTTPTooManyRequests in MetricsExporter#send_bytes') FAILURE when Net::HTTPRequestTimeOut, Net::HTTPGatewayTimeOut, Net::HTTPBadGateway response.body # Read and discard body redo if backoff?(retry_count: retry_count += 1, reason: response.code) OpenTelemetry.logger.warn('Net::HTTPRequestTimeOut/Net::HTTPGatewayTimeOut/Net::HTTPBadGateway in MetricsExporter#send_bytes') FAILURE when Net::HTTPNotFound OpenTelemetry.handle_error(message: "OTLP metrics_exporter received http.code=404 for uri: '#{@path}'") FAILURE when Net::HTTPBadRequest, Net::HTTPClientError, Net::HTTPServerError log_status(response.body) OpenTelemetry.logger.warn('Net::HTTPBadRequest/Net::HTTPClientError/Net::HTTPServerError in MetricsExporter#send_bytes') FAILURE when Net::HTTPRedirection @http.finish handle_redirect(response['location']) redo if backoff?(retry_after: 0, retry_count: retry_count += 1, reason: response.code) else @http.finish OpenTelemetry.logger.warn("Unexpected error in OTLP::MetricsExporter#send_bytes - #{response.message}") FAILURE end rescue Net::OpenTimeout, Net::ReadTimeout retry if backoff?(retry_count: retry_count += 1, reason: 'timeout') OpenTelemetry.logger.warn('Net::OpenTimeout/Net::ReadTimeout in MetricsExporter#send_bytes') return FAILURE rescue OpenSSL::SSL::SSLError retry if backoff?(retry_count: retry_count += 1, reason: 'openssl_error') OpenTelemetry.logger.warn('OpenSSL::SSL::SSLError in MetricsExporter#send_bytes') return FAILURE rescue SocketError retry if backoff?(retry_count: retry_count += 1, reason: 'socket_error') OpenTelemetry.logger.warn('SocketError in MetricsExporter#send_bytes') return FAILURE rescue SystemCallError => e retry if backoff?(retry_count: retry_count += 1, reason: e.class.name) OpenTelemetry.logger.warn('SystemCallError in MetricsExporter#send_bytes') return FAILURE rescue EOFError retry if backoff?(retry_count: retry_count += 1, reason: 'eof_error') OpenTelemetry.logger.warn('EOFError in MetricsExporter#send_bytes') return FAILURE rescue Zlib::DataError retry if backoff?(retry_count: retry_count += 1, reason: 'zlib_error') OpenTelemetry.logger.warn('Zlib::DataError in MetricsExporter#send_bytes') return FAILURE rescue StandardError => e OpenTelemetry.handle_error(exception: e, message: 'unexpected error in OTLP::MetricsExporter#send_bytes') return FAILURE end ensure # Reset timeouts to defaults for the next call. @http.open_timeout = @timeout @http.read_timeout = @timeout @http.write_timeout = @timeout end |
#shutdown(timeout: nil) ⇒ Object
Marks this exporter as shut down so subsequent exports fail.
399 400 401 402 403 404 405 406 407 |
# File 'lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb', line 399 def shutdown(timeout: nil) if @shutdown OpenTelemetry.logger.warn('Exporter already shutdown, ignoring call') return end @shutdown = true SUCCESS end |