---
title: "Postgres"
description: "Adds instrumentation for Postgres. (default)"
url: https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/postgres/
---

# Postgres | Sentry for Hapi

This integration only works in the Node.js and Bun runtimes.

*Import name: `Sentry.postgresIntegration`*

This integration is enabled by default when performance monitoring is enabled. If you'd like to modify your default integrations, read [this](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations.md#modifying-default-integrations).

The `postgresIntegration` adds instrumentation for the `pg` library to capture spans using [`@opentelemetry/instrumentation-pg`](https://www.npmjs.com/package/@opentelemetry/instrumentation-pg).

```JavaScript
Sentry.init({
  integrations: [Sentry.postgresIntegration()],
});
```

## [Options](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/postgres.md#options)

### [`ignoreConnectSpans`](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/postgres.md#ignoreconnectspans)

*Type: `boolean`*

*Available since: `10.40.0`*

When `true`, the integration does not create spans for `pg.connect` or `pg.pool.connect` calls. Use this to reduce trace noise when connection setup is not useful to monitor. Default is `false`.

```JavaScript
Sentry.init({
  integrations: [Sentry.postgresIntegration({ ignoreConnectSpans: true })],
});
```

## [Supported Versions](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/postgres.md#supported-versions)

* `pg`: `>=8 <9`
