Package brave.mongodb
Class MongoDBTracing
java.lang.Object
brave.mongodb.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 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.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MongoDBTracing.Builder
-
Method Summary
Modifier and Type Method Description com.mongodb.event.CommandListener
commandListener()
static MongoDBTracing
create(Tracing tracing)
static MongoDBTracing.Builder
newBuilder(Tracing tracing)
-
Method Details
-
create
-
newBuilder
-
commandListener
public com.mongodb.event.CommandListener commandListener()
-