{"name":"@opentelemetry/instrumentation-pg","version":"0.34.1","description":"OpenTelemetry postgres automatic instrumentation package.","main":"build/src/index.js","types":"build/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/open-telemetry/opentelemetry-js-contrib.git"},"scripts":{"clean":"rimraf build/*","compile":"tsc -p .","lint":"eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix","precompile":"tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-pg --include-dependencies","prewatch":"npm run precompile","prepare":"npm run compile","tdd":"npm run test -- --watch-extensions ts --watch","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","test-all-versions":"cross-env IN_TAV=true tav","test-all-versions:local":"cross-env IN_TAV=true RUN_POSTGRES_TESTS_LOCAL=true npm run test-all-versions","test:debug":"ts-mocha --inspect-brk --no-timeouts -p tsconfig.json 'test/**/*.test.ts'","test:local":"cross-env RUN_POSTGRES_TESTS_LOCAL=true npm run test","version:update":"node ../../../scripts/version-update.js","watch":"tsc -w"},"keywords":["instrumentation","nodejs","opentelemetry","pg","plugin","postgres","postgresql","profiling","tracing"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","engines":{"node":">=14"},"publishConfig":{"access":"public"},"peerDependencies":{"@opentelemetry/api":"^1.3.0"},"devDependencies":{"@opentelemetry/api":"^1.3.0","@opentelemetry/context-async-hooks":"^1.8.0","@opentelemetry/contrib-test-utils":"^0.33.1","@opentelemetry/sdk-trace-base":"^1.8.0","@opentelemetry/sdk-trace-node":"^1.8.0","@types/mocha":"7.0.2","@types/node":"18.11.7","@types/sinon":"10.0.2","cross-env":"7.0.3","gts":"3.1.0","mocha":"7.2.0","nyc":"15.1.0","pg":"8.7.1","pg-pool":"3.4.1","rimraf":"3.0.2","safe-stable-stringify":"^2.4.1","sinon":"15.0.1","test-all-versions":"5.0.1","ts-mocha":"10.0.0","typescript":"4.4.4"},"dependencies":{"@opentelemetry/core":"^1.8.0","@opentelemetry/instrumentation":"^0.35.1","@opentelemetry/semantic-conventions":"^1.0.0","@types/pg":"8.6.1","@types/pg-pool":"2.0.3"},"homepage":"https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-pg#readme","gitHead":"63e0fc9b6b862f74304abf0343c506a5bd415191","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js-contrib/issues"},"_id":"@opentelemetry/instrumentation-pg@0.34.1","_nodeVersion":"14.21.2","_npmVersion":"lerna/5.5.2/node@v14.21.2+x64 (linux)","dist":{"integrity":"sha512-nM8fCZk3mD7NWeVl3HH3S+k+YLE+XyasdD3PaZpxX79dLSayg35JR5rPxn4AbVCXrkwrywYGxKCzmA5gNFBfAQ==","shasum":"d1d3626bf7349a5c557b124b886fc3a30b20ddd9","tarball":"http://registry-npm.ywwl.com/@opentelemetry/instrumentation-pg/download/@opentelemetry/instrumentation-pg-0.34.1.tgz","fileCount":24,"unpackedSize":71918,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB0N1qRdXsgcLRnrHQJDPZtqAKwqpGTL6KYDzuAwOo1fAiEArGNeady/sEGlxoZ62MYzSsJd0XJZ788dRyX6dfYscKw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4tsEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr1uA//TWtA9G85uanCrF7CdqhfIq/invKpuo4FKj13kzm1KeyebPxH\r\n5N1L/Izi7kWIvH7KV6UNh3Azv6iQz1SB7qKZz39bhmdhv4bQR6CA2ErN4q3y\r\nPY56x9/KKIzqU3+eQUpDT/AL3ztYgbPmVZiSo686++fW8b/o7TX7DHACzmBT\r\n65G7A5TuOY51NCvqhXUeoUATnvkMTk8BIbceyMadg4UH1qH9tRj00HtC3sH4\r\nTJEZqoogEaiXw3U0sTIdNaf812kZN3KU7phGwx3xqf2inNQoOr4oLznytQCB\r\nGS+wRuxvdOlhypILGQBSZrP/YnhG34c9C9uNlGfvjR1bFiSbJTIBsQL4aA1q\r\noqxYMrM0rGSD8hLK1jIDhkqkUWy92SBLXoFMtD5eu2lWDDkTDFWjTA2xlAod\r\nzKZxIZCUISk+5SbJVsoVFmySbBQT/zQCJhRqUY+1hDV2OaDdTXPezU4lGVXn\r\nmERrFB9P3vBp943Es8rUex8/u2TfVb/H8eMJ4j/+4mFceb5Ggfxj7ZrBkQFT\r\nA7gxnNJqUULwc4TFgfebkZp9sgY/hov8wIhKdFdhYtWDmtcj6CXo/eoKf5Si\r\nsBT6/OSlw9yqu33wqmRkbwUpq71MusywbhaAN+Uxh7ItlXtcu3d4PLMqXuhd\r\ncDEiqcIOu2fnl9nWyXntgwnF1i9B878duKY=\r\n=7Twg\r\n-----END PGP SIGNATURE-----\r\n","size":19056,"noattachment":false,"key":"/@opentelemetry/instrumentation-pg/-/@opentelemetry/instrumentation-pg-0.34.1.tgz"},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"directories":{},"maintainers":[{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/instrumentation-pg_0.34.1_1675811587949_0.9237757301107159"},"_hasShrinkwrap":false,"readme":"# OpenTelemetry Postgres Instrumentation for Node.js\n\n[![NPM Published Version][npm-img]][npm-url]\n[![Apache License][license-image]][license-image]\n\nThis module provides automatic instrumentation for the [`pg`](https://github.com/brianc/node-postgres)module, which may be loaded using the [`@opentelemetry/sdk-trace-node`](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node) package and is included in the [`@opentelemetry/auto-instrumentations-node`](https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node) bundle.\n\nIf total installation size is not constrained, it is recommended to use the [`@opentelemetry/auto-instrumentations-node`](https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node) bundle with [@opentelemetry/sdk-node](`https://www.npmjs.com/package/@opentelemetry/sdk-node`) for the most seamless instrumentation experience.\n\nCompatible with OpenTelemetry JS API and SDK `1.0+`.\n\n## Installation\n\n```bash\nnpm install --save @opentelemetry/instrumentation-pg\n```\n\n### Supported Versions\n\n- `>=8 <9`\n\n## Usage\n\n```js\nconst { PgInstrumentation } = require('@opentelemetry/instrumentation-pg');\nconst { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');\nconst { registerInstrumentations } = require('@opentelemetry/instrumentation');\n\nconst provider = new NodeTracerProvider();\nprovider.register();\n\nregisterInstrumentations({\n  instrumentations: [\n    new PgInstrumentation(),\n  ],\n});\n```\n\nPgInstrumentation contains both pg and [`pg.Pool`](https://node-postgres.com/api/pool) so it will be instrumented automatically.\n\n### PostgreSQL Instrumentation Options\n\nPostgreSQL instrumentation has few options available to choose from. You can set the following:\n\n| Options | Type | Description |\n| ------- | ---- | ----------- |\n| [`enhancedDatabaseReporting`](./src/types.ts#L30) | `boolean` | If true, additional information about query parameters and results will be attached (as `attributes`) to spans representing database operations |\n| `requestHook` | `PgInstrumentationExecutionRequestHook` (function) | Function for adding custom span attributes using information about the query being issued and the db to which it's directed |\n| `responseHook` | `PgInstrumentationExecutionResponseHook` (function) | Function for adding custom span attributes from db response |\n| `requireParentSpan` | `boolean` | If true, requires a parent span to create new spans (default false) |\n| `addSqlCommenterCommentToQueries` | `boolean` | If true, adds [sqlcommenter](https://github.com/open-telemetry/opentelemetry-sqlcommenter) specification compliant comment to queries with tracing context (default false). _NOTE: A comment will not be added to queries that already contain `--` or `/* ... */` in them, even if these are not actually part of comments_ |\n\n## Useful links\n\n- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>\n- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>\n- For help or feedback on this project, join us in [GitHub Discussions][discussions-url]\n\n## License\n\nApache 2.0 - See [LICENSE][license-url] for more information.\n\n[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions\n[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/LICENSE\n[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat\n[npm-url]: https://www.npmjs.com/package/@opentelemetry/instrumentation-pg\n[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Finstrumentation-pg.svg\n","publish_time":1675811588164,"_cnpm_publish_time":1675811588164,"dist-tags":{"latest":"0.78.0"}}