Registry / database / newrelic-go-agent-v3-integrations-nrmongo

newrelic-go-agent-v3-integrations-nrmongo

JSON →
library1.1.5gogounverified

Package nrmongo instruments the MongoDB Go driver for New Relic monitoring.

go get github.com/newrelic/go-agent/v3/integrations/nrmongo
INSTALL
IMPORT
SIG · NEWRELIC-GO-AGENT-
N
newrelic-go-agent-v3-integrations-nrmongo
databasegov1.1.5
harness data pending
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()) }
Debug
Known issues
gotchaRequires a valid New Relic license key and application name to function.
fix
Set the NEW_RELIC_LICENSE_KEY environment variable or configure via code.
affects: >=1.0.0
Upgrade
Version history
1.1.5latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
6
OpenAI (training)
2
Resources
newrelic-go-agent-v3-integrations-nrmongo — go get newrelic-go-agent-v3-integrations-nrmongo · libregistry