Sha256: d5b35f1946b899759402c790b4c12b7b5d7231f764b2400c9d28ece75cf83c02

Contents?: true

Size: 875 Bytes

Versions: 4

Compression:

Stored size: 875 Bytes

Contents

require 'securerandom'
require 'ddtrace/ext/runtime'
require 'ddtrace/utils/forking'

module Datadog
  module Runtime
    # For runtime identity
    module Identity
      extend Datadog::Utils::Forking

      module_function

      # Retrieves number of classes from runtime
      def id
        @id ||= SecureRandom.uuid

        # Check if runtime has changed, e.g. forked.
        after_fork! { @id = SecureRandom.uuid }

        @id
      end

      def lang
        Ext::Runtime::LANG
      end

      def lang_engine
        Ext::Runtime::LANG_ENGINE
      end

      def lang_interpreter
        Ext::Runtime::LANG_INTERPRETER
      end

      def lang_platform
        Ext::Runtime::LANG_PLATFORM
      end

      def lang_version
        Ext::Runtime::LANG_VERSION
      end

      def tracer_version
        Ext::Runtime::TRACER_VERSION
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ddtrace-0.50.0 lib/ddtrace/runtime/identity.rb
ddtrace-0.49.0 lib/ddtrace/runtime/identity.rb
ddtrace-0.48.0 lib/ddtrace/runtime/identity.rb
ddtrace-0.47.0 lib/ddtrace/runtime/identity.rb