contrib/go.mongodb.org/mongo-driver/mongo

contrib/go.mongodb.org/mongo-driver/mongo

Those integration are enabled by having the following import in the project’s orchestrion.tool.go file:

import (
	_ "github.com/DataDog/orchestrion"

	_ "gopkg.in/DataDog/dd-trace-go.v1/contrib/go.mongodb.org/mongo-driver/mongo" // integration
	//...
)

Official Golang driver for MongoDB.

Client

Join Point
Advice
Replace the expression using the template:
// Using the following synthetic imports:
import (
	mongotrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/go.mongodb.org/mongo-driver/mongo"
	options "go.mongodb.org/mongo-driver/mongo/options"
)
{{ . }}.SetMonitor(mongotrace.NewMonitor())