Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions src/platforms/node/common/performance/database.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,35 @@ Supported packages and their integration name:

### Disabling Automatic Instrumentation

You can also (remove an automatically-enabled integration)[integrations](/platforms/node/configuration/integrations/#removing-an-integration), if needed.
You can also [remove an automatically-enabled integration](/platforms/node/configuration/integrations/#removing-an-integration), if needed.

### Manually Adding Integrations

If you need to add a specific database integration manually (for example, when using multiple client instances), you can import them from the `@sentry/tracing` package under the `Integrations` namespace.

For example, to add MongoDB instrumentation to a custom client:
For example:

```javascript
```javascript{tabTitle: MongoDB}
const Sentry = require("@sentry/node");
const Tracing = require("@sentry/tracing");
const mongodb = require("mongodb");

const client = new Sentry.NodeClient({
dsn: "___PUBLIC_DSN___",
integrations: [new Tracing.Integrations.Mongo()],
integrations: [new Tracing.Integrations.Mongo({
useMongoose: true // Default: false
})],
});
```

```javascript{tabTitle: Postgres}
const Sentry = require("@sentry/node");
const Tracing = require("@sentry/tracing");

const client = new Sentry.NodeClient({
dsn: "___PUBLIC_DSN___",
integrations: [new Tracing.Integrations.Postgres({
usePgNative: true // Default: false
})],
});
```