Registry /
database / newrelic-go-agent-v3-integrations-nrmongo
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
nrmongo
✓ github.com/newrelic/go-agent/v3/integrations/nrmongo
Creates a MongoDB client with New Relic monitoring.
package main
import (
"context"
"github.com/newrelic/go-agent/v3/newrelic"
"github.com/newrelic/go-agent/v3/integrations/nrmongo"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
)
func main() {
app, _ := newrelic.NewApplication(newrelic.ConfigAppName("MyApp"), newrelic.ConfigLicense("LICENSE_KEY"))
client, _ := mongo.Connect(context.Background(), options.Client().SetMonitor(nrmongo.NewCommandMonitor(nrmongo.WithApp(app))))
defer client.Disconnect(context.Background())
}
Upgrade
Version history
1.1.5latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.