Module: OpenTelemetry

Defined in:
lib/opentelemetry/metrics.rb,
lib/opentelemetry/metrics/meter.rb,
lib/opentelemetry/metrics/version.rb,
lib/opentelemetry/metrics/instrument.rb,
lib/opentelemetry/metrics/measurement.rb,
lib/opentelemetry/internal/proxy_meter.rb,
lib/opentelemetry/metrics/meter_provider.rb,
lib/opentelemetry/internal/proxy_instrument.rb,
lib/opentelemetry/metrics/instrument/counter.rb,
lib/opentelemetry/metrics/instrument/histogram.rb,
lib/opentelemetry/internal/proxy_meter_provider.rb,
lib/opentelemetry/metrics/instrument/up_down_counter.rb,
lib/opentelemetry/metrics/instrument/observable_gauge.rb,
lib/opentelemetry/metrics/instrument/observable_counter.rb,
lib/opentelemetry/metrics/instrument/observable_up_down_counter.rb,
lib/opentelemetry-metrics-api.rb

Overview

OpenTelemetry is an open source observability framework, providing a general-purpose API, SDK, and related tools required for the instrumentation of cloud-native software, frameworks, and libraries.

The OpenTelemetry module provides global accessors for telemetry objects.

Defined Under Namespace

Modules: Internal, Metrics

Instance Method Summary collapse

Instance Method Details

#meter_providerObject, Metrics::MeterProvider

Returns registered meter provider or a default no-op implementation of the meter provider.

Returns:

  • (Object, Metrics::MeterProvider)

    registered meter provider or a default no-op implementation of the meter provider.



38
39
40
# File 'lib/opentelemetry-metrics-api.rb', line 38

def meter_provider
  @mutex.synchronize { @meter_provider }
end

#meter_provider=(provider) ⇒ Object

Register the global meter provider.

Parameters:

  • provider (MeterProvider)

    A meter provider to register as the global instance.



26
27
28
29
30
31
32
33
34
# File 'lib/opentelemetry-metrics-api.rb', line 26

def meter_provider=(provider)
  @mutex.synchronize do
    if @meter_provider.instance_of? Internal::ProxyMeterProvider
      logger.debug("Upgrading default proxy meter provider to #{provider.class}")
      @meter_provider.delegate = provider
    end
    @meter_provider = provider
  end
end