Sha256: ddb4151bdb14c4b8a64bf7b75b7fdc2d4894700787d3280eaa6aae141a6c63eb

Contents?: true

Size: 1.24 KB

Versions: 1

Compression:

Stored size: 1.24 KB

Contents

# frozen_string_literal: true

# Copyright 2019 OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0
require 'logger'

require 'opentelemetry/error'
require 'opentelemetry/context'
require 'opentelemetry/distributed_context'
require 'opentelemetry/internal'
require 'opentelemetry/metrics'
require 'opentelemetry/trace'
require 'opentelemetry/version'

# OpenTelemetry provides global accessors for telemetry objects
module OpenTelemetry
  extend self

  attr_writer :tracer_factory, :meter_factory, :distributed_context_manager

  attr_accessor :logger

  # @return [Object, Trace::TracerFactory] registered tracer factory or a
  #   default no-op implementation of the tracer factory.
  def tracer_factory
    @tracer_factory ||= Trace::TracerFactory.new
  end

  # @return [Object, Metrics::MeterFactory] registered meter factory or a
  #   default no-op implementation of the meter factory.
  def meter_factory
    @meter_factory ||= Metrics::MeterFactory.new
  end

  # @return [Object, DistributedContext::Manager] registered distributed
  #   context manager or a default no-op implementation of the manager
  def distributed_context_manager
    @distributed_context_manager ||= DistributedContext::Manager.new
  end

  self.logger = Logger.new(STDOUT)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opentelemetry-api-0.2.0 lib/opentelemetry.rb