Package brave.mongodb

Class MongoDBTracing


  • public final class MongoDBTracing
    extends Object
    Use this class to decorate your MongoDB client and enable Tracing.

    To use it, call .addCommandListener(MongoDBTracing.create(tracing).commandListener()) on the com.mongodb.MongoClientOptions or MongoClientSettings object that is used to create the MongoClient to be instrumented. As of now, this instrumentation can only be used with the synchronous MongoDB driver. Do not use it with the asynchronous or reactive drivers as tracing data will be incorrect.

    • Method Detail

      • create

        public static MongoDBTracing create​(brave.Tracing tracing)
      • commandListener

        public com.mongodb.event.CommandListener commandListener()