Interceptor for postgres database clients, enabling distributed tracing with Zipkin. This package provides middleware to automatically trace PostgreSQL queries. The current stable version is 0.22.0 (published Aug 2020). It is part of the Zipkin JS ecosystem, maintained by OpenZipkin, with releases typically on-demand. It is designed for use with `zipkin` and requires a `pg` client instance. Compared to other tracing solutions, it integrates seamlessly with the Zipkin library and supports both callback and promise-based `pg` usage.
npm install zipkin-instrumentation-postgresNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes Zipkin tracer with HTTP transport, instruments a pg Client, and runs a traced query.
Upgrade Node.js to version 10 or later.
Migrate to OpenTelemetry JS with @opentelemetry/instrumentation-pg.
Always pass `remoteServiceName` in the options object.
Use `instrumentPostgres` on each `Client` instance obtained from a Pool.
Use `import { instrumentPostgres } from 'zipkin-instrumentation-postgres'`.Ensure you pass a `pg.Client` instance, not a Pool or a non-object.
Add `remoteServiceName: 'your-db-service-name'` to the options object.
Update package to >=0.20.0 and use `import { instrumentPostgres } from 'zipkin-instrumentation-postgres'`.