{"name":"@opentelemetry/instrumentation-pg","version":"0.14.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.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"},"devDependencies":{"@opentelemetry/context-async-hooks":"^0.18.0","@opentelemetry/node":"^0.18.0","@opentelemetry/test-utils":"^0.14.0","@opentelemetry/tracing":"^0.18.0","@types/mocha":"7.0.2","@types/node":"14.0.27","@types/pg":"7.14.4","@types/pg-pool":"2.0.2","codecov":"3.7.2","cross-env":"7.0.2","gts":"3.1.0","mocha":"7.2.0","nyc":"15.1.0","pg":"8.3.0","pg-pool":"3.2.1","rimraf":"3.0.2","ts-mocha":"8.0.0","ts-node":"9.0.0","tslint-consistent-codestyle":"1.16.0","tslint-microsoft-contrib":"6.2.0","typescript":"4.1.3"},"dependencies":{"@opentelemetry/api":"^0.18.0","@opentelemetry/instrumentation":"^0.18.0"},"gitHead":"7a87f4105ff432380132d81f56a33e3f5c4e8fb1","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"homepage":"https://github.com/open-telemetry/opentelemetry-js#readme","_id":"@opentelemetry/instrumentation-pg@0.14.0","_nodeVersion":"12.21.0","_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (darwin)","dist":{"integrity":"sha512-IgWLY5WDU7qgAysLg8HFyoLawps3GhzVUExMLtmydnRYEijHY3BDP0Jct6n4mHqn/zlwbuslDWrg+CcmMakSfQ==","shasum":"0e3ab34e19b450d101f26253b5c988d776b4fc83","tarball":"http://registry-npm.ywwl.com/@opentelemetry/instrumentation-pg/download/@opentelemetry/instrumentation-pg-0.14.0.tgz","fileCount":15,"unpackedSize":41894,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQqJYCRA9TVsSAnZWagAA8tcP/AoJNTXZ0NtEtRdJckJz\nCbJXldqdW+xzN4TKACPoFKmyaELXv2HKFyazP2I3ChWL50kfAK6S6+1NIsoU\nQ3szGXyDPggJwlNsAjSWEr6cMDV2UIzsdin/c7/vpswcCc0cHvmCnKu/Smpc\njy9r1MkEtpaG2VCtfFjxZikD20dZObm5FOORbX5CDUr6KjAoanWNfsIqUyBY\nMNT+9D+SKKDfaFFrOqUe2Jm9wCZtHTZrZpSwZaK4zfnMuTiuQY1/onnq87Ys\nYFTW1mCPrUiBlD09bJXzVngaSGzOZwANK8gGd237ePx8s/fs5yMYscSbZswI\ntmhKNUdSjOZZcz7kChmk9IfMAQjl1SOzUNtceu77NmwW4nK9HXlZqsr+jIzY\npnlXJXAzVgXaZiKb0B4rssbTAFlZtXXY/qgC8TFRTIZU2bVeoR71zNuPHVo1\nGI+RXFNImqmzJxE7Ah4jQJc8KMFU1o7FnPrbIYfA/P3Kvh7d8dIOe4yPXvj/\nMAjAMUrDn9xKTANBHqXLTllta0+oyUAmsAXzw+2NrPW0lHYhEsi5fumN2slV\nrVySu7gsKgfzuRTpHuzMuhp16QEBmWT4PA5zMWS/oROw2Zqaew8vq771slLY\n2tYZWxFkPAlLcFreH4DDDNUXl/Wan5Wlmy3lNgX5wr3fUifUK5mUWPnA/hPH\nqLcY\r\n=312j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBHnVKX2vmL4UoEXxDB4aJZBnYF/zMtGQN5E8va2UdgKAiAxICLUmQ7DfucROtkqMpYbmXSpNqanThQ1HwqRQYwWpA=="}],"size":10816,"noattachment":false,"key":"/@opentelemetry/instrumentation-pg/-/@opentelemetry/instrumentation-pg-0.14.0.tgz"},"_npmUser":{"name":"obecny","email":"bobecny@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.14.0_1614979671972_0.21312451054896164"},"_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":1614979672227,"_cnpm_publish_time":1614979672227,"dist-tags":{"latest":"0.78.0"}}