Documentation ¶
Overview ¶
Package ppmongo instruments the mongodb/mongo-go-driver package (https://github.com/mongodb/mongo-go-driver).
This package instruments the mongo-go-driver calls. Use the NewMonitor as Monitor field of mongo-go-driver's ClientOptions.
opts := options.Client() opts.Monitor = ppmongo.NewMonitor() client, err := mongo.Connect(ctx, opts)
It is necessary to pass the context containing the pinpoint.Tracer to mongo.Client.
collection := client.Database("testdb").Collection("example") ctx := pinpoint.NewContext(context.Background(), tracer) collection.InsertOne(ctx, bson.M{"foo": "bar", "apm": "pinpoint"})
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMonitor ¶
func NewMonitor() *event.CommandMonitor
NewMonitor returns a *event.CommandMonitor ready to instrument.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.