{"name":"@opentelemetry/instrumentation-pg","version":"0.24.0","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":"npm run version:update && tsc -p .","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../../","lint":"eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix","precompile":"tsc --version","prepare":"npm run compile","tdd":"npm run test -- --watch-extensions ts --watch","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","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":["opentelemetry","postgres","pg","postgresql","nodejs","tracing","profiling","plugin","instrumentation"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","engines":{"node":">=8.5.0"},"publishConfig":{"access":"public"},"peerDependencies":{"@opentelemetry/api":"^1.0.1"},"devDependencies":{"@opentelemetry/api":"1.0.1","@opentelemetry/context-async-hooks":"0.24.0","@opentelemetry/node":"0.24.0","@opentelemetry/test-utils":"^0.24.0","@opentelemetry/tracing":"0.24.0","@types/mocha":"7.0.2","@types/node":"14.17.5","codecov":"3.8.3","cross-env":"7.0.3","gts":"3.1.0","mocha":"7.2.0","nyc":"15.1.0","pg":"8.6.0","pg-pool":"3.3.0","rimraf":"3.0.2","ts-mocha":"8.0.0","typescript":"4.3.5"},"dependencies":{"@opentelemetry/instrumentation":"^0.24.0","@opentelemetry/semantic-conventions":"^0.24.0","@types/pg":"8.6.1","@types/pg-pool":"2.0.3"},"gitHead":"e4757035a7b4012703a98b5609b8ac0f859e9726","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js-contrib/issues"},"homepage":"https://github.com/open-telemetry/opentelemetry-js-contrib#readme","_id":"@opentelemetry/instrumentation-pg@0.24.0","_nodeVersion":"14.17.3","_npmVersion":"lerna/3.22.1/node@v14.17.3+x64 (linux)","dist":{"integrity":"sha512-sRFWArL0Kj1af/Se3wm3SXNVJ/VywSJoWDnKxHjP67Ejqx1aiMQhv6WLnkE+coQykywG3jPBpCuQkZJoS1xcHg==","shasum":"45d4f44d0c4afd73be6e43ccffa621f7b34152b2","tarball":"http://registry-npm.ywwl.com/@opentelemetry/instrumentation-pg/download/@opentelemetry/instrumentation-pg-0.24.0.tgz","fileCount":24,"unpackedSize":54934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAwZiCRA9TVsSAnZWagAAYN8P/RX4wvemS9KGenItGuy/\nP+GmXoJy52QVtFChu7N0bNDVkbfGSlvp5PR7MMrk+D8ZgVuia7buTAjwpB8L\ntBVyyoSYBINoc9RqK0pC12RBWJnnWZZkJhquSF31QN9edOHfxOReMzMLno+B\n21xO6w3ivsf8CW4g5dtObv0WXzvxhiH8bh7Y+je9/q1oxCk6zh8+aKnZfB7b\nrbxKTulC7C+sNy0y9TexOD6BW9VbKiyUoVFCXsIQQVn4HACGu9DV/sHLtHtR\nYQgy0+N8hqAgcbH01I3tzIYfIBgCajJD+rjsYO9Y4o0zTqhD5T58iv3GzZ6l\nWtN++HX+2JCgz2JBTODTbTb6YmY0mutgHzmzx1SUCNLi5lBnEQtAGUnGzoUQ\nUR6Y4slGEwF9P+Ht+zk47rdKADRbt9CNr7n2K1rF0GAyedfnwwqvhjAAcURk\ncMnNw6cZESgXhTPul/Myol/mhD5+MgCUBKxfSe7U47PxsVh2e/ZW8uDVOGSm\nSee+DHrMuJGP5mszerC+JN2ZLA3O5d4nP7qfF4q6zPV6TLsrJg3SIxzjc7Ww\nR69PPZDmeiLvEo4ZwnDcAhthK6QOaK1XbyYx+ABQIfutKKPdTwINLunYAqxy\n/YastDhh6/Ho3a8mb2S7KVK/aPc6drN423GOZJcaL7HWZNyrN8l33MhmCL4K\nYXto\r\n=CsKw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYfaNjtk+m8CRVahIGwCRFcLr3eyHw15W9/K0X97wXAAIhAKUGhs9BU+BqWtQyF6Wi7pV+7R4XI5NacJAKgYaas0Uc"}],"size":14063,"noattachment":false,"key":"/@opentelemetry/instrumentation-pg/-/@opentelemetry/instrumentation-pg-0.24.0.tgz"},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"directories":{},"maintainers":[{"name":"mayurkale22","email":"mayurkale22@gmail.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"},{"name":"obecny","email":"bobecny@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/instrumentation-pg_0.24.0_1627588194661_0.9495889555553654"},"_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":1627588194849,"_cnpm_publish_time":1627588194849,"dist-tags":{"latest":"0.78.0"}}