Skip to content

Commit 1eb8c64

Browse files
authored
feat: Update examples to cover pg-native integration usage. (#4015)
* feat: Update examples to cover `pg-native` integration usage. * Fix link. * Add `pg-native` to supported packages list. * Add initially available version for pg-native integration.
1 parent 4b23892 commit 1eb8c64

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

src/platforms/node/common/performance/database.mdx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,42 @@ Node.js integrations support tracking database queries as spans. Starting in ver
66

77
Supported packages and their integration name:
88
- `pg` (Postgres)
9+
- `pg-native` (Postgres) _Available from version 6.12.0_
910
- `mongodb` (Mongo)
1011
- `mongoose` (Mongo)
1112
- `mysql` (MySQL)
1213

1314
### Disabling Automatic Instrumentation
1415

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

1718
### Manually Adding Integrations
1819

1920
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.
2021

21-
For example, to add MongoDB instrumentation to a custom client:
22+
For example:
2223

23-
```javascript
24+
```javascript{tabTitle: MongoDB}
2425
const Sentry = require("@sentry/node");
2526
const Tracing = require("@sentry/tracing");
2627
const mongodb = require("mongodb");
2728
2829
const client = new Sentry.NodeClient({
2930
dsn: "___PUBLIC_DSN___",
30-
integrations: [new Tracing.Integrations.Mongo()],
31+
integrations: [new Tracing.Integrations.Mongo({
32+
useMongoose: true // Default: false
33+
})],
34+
});
35+
```
36+
37+
```javascript{tabTitle: Postgres}
38+
const Sentry = require("@sentry/node");
39+
const Tracing = require("@sentry/tracing");
40+
41+
const client = new Sentry.NodeClient({
42+
dsn: "___PUBLIC_DSN___",
43+
integrations: [new Tracing.Integrations.Postgres({
44+
usePgNative: true // Default: false
45+
})],
3146
});
3247
```

0 commit comments

Comments
 (0)