Sha256: 8d3b3f6a0c0f4b31682d13cc68f6051700bbcd812920731fe032997f3a9cec18

Contents?: true

Size: 481 Bytes

Versions: 30

Compression:

Stored size: 481 Bytes

Contents

# (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2021

module Instana
  module Activators
    class Mongo < Activator
      def can_instrument?
        defined?(::Mongo::Client) && defined?(::Mongo::Monitoring::Global)
      end

      def instrument
        require 'instana/instrumentation/mongo'

        ::Mongo::Monitoring::Global.subscribe(
          ::Mongo::Monitoring::COMMAND,
          ::Instana::Mongo.new
        )

        true
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
instana-1.209.6 lib/instana/activators/mongo.rb
instana-1.209.5 lib/instana/activators/mongo.rb
instana-1.209.4 lib/instana/activators/mongo.rb
instana-1.209.3 lib/instana/activators/mongo.rb
instana-1.209.2 lib/instana/activators/mongo.rb
instana-1.209.1 lib/instana/activators/mongo.rb
instana-1.209.0.pre3 lib/instana/activators/mongo.rb
instana-1.209.0.pre2 lib/instana/activators/mongo.rb
instana-1.209.0.pre1 lib/instana/activators/mongo.rb
instana-1.208.0 lib/instana/activators/mongo.rb