{"name":"@opentelemetry/instrumentation-knex","version":"0.68.0","keywords":["instrumentation","knex","nodejs","opentelemetry","tracing"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/instrumentation-knex@0.68.0","maintainers":[{"name":"dyladan","email":"dyladan@gmail.com"},{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"overbalance","email":"overbalancedev@proton.me"},{"name":"npmjs-account","email":"npmjs-account@opentelemetry.io"},{"name":"trentm","email":"trentm@gmail.com"},{"name":"martinkuba","email":"martin@martinkuba.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-knex#readme","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js-contrib/issues"},"dist":{"shasum":"be31d84c23e4d5a80bb4d4af26629f809b29db72","tarball":"http://registry-npm.ywwl.com/@opentelemetry/instrumentation-knex/download/@opentelemetry/instrumentation-knex-0.68.0.tgz","fileCount":36,"integrity":"sha512-sCXpcMsx4Qbg5WZ+vzmaGDJnlUjrVee+cQ812xYkcmjRoYCcQH1L631rqHfUOu9OqqCwtt2/iRIzRcJYUx5lKg==","signatures":[{"sig":"MEQCIGWDM9erqwLmgiy7kbWwCv2Beg6NIrchNxvlxXMv9UPzAiAYt3pKlhxJ+6H9NpRuCJi7/XqZ8dtPWTAdw/K/b6skqg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIG44cFyEAuf/+DWRDtzE0RQ81L6ucO0LqXKBW636SpAXAiBREzwd58BCCo1QM1GS/K3wIARLV/uUx7aQr1Z3lWpwRA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@opentelemetry%2finstrumentation-knex@0.68.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":76293,"size":17897,"noattachment":false,"key":"/@opentelemetry/instrumentation-knex/-/@opentelemetry/instrumentation-knex-0.68.0.tgz"},"main":"./dist/index.cjs","types":"./dist/index.d.cts","engines":{"node":">=22.15.0"},"exports":{".":{"default":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"207b9dd1c7e30c12d5dec0e54e476e361b209484","scripts":{"tdd":"npm test -- --watch --watch-files \"**/*.ts\"","test":"nyc mocha 'test/**/*.ts'","clean":"rimraf dist build","watch":"tsdown --watch --no-clean","compile":"tsdown","lint:readme":"node ../../scripts/lint-readme","prepublishOnly":"npm run compile","version:update":"node ../../scripts/version-update.js","test-all-versions":"tav","compile:with-dependencies":"nx run-many -t compile -p @opentelemetry/instrumentation-knex"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"1be76e11-41c4-4947-9b6b-3016687478e3"}},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js-contrib.git","type":"git","directory":"packages/instrumentation-knex"},"_npmVersion":"lerna/9.0.7/node@v24.21.0+x64 (linux)","description":"OpenTelemetry instrumentation for `knex` database SQL query builder","directories":{},"_nodeVersion":"24.21.0","dependencies":{"@opentelemetry/instrumentation":"^0.300.0","@opentelemetry/semantic-conventions":"^1.33.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"knex":"3.1.0","sqlite3":"5.1.7","better-sqlite3":"^12.11.1","@opentelemetry/api":"^1.10.0","@opentelemetry/sdk-trace":"^3.0.0","@opentelemetry/context-async-hooks":"^3.0.0"},"peerDependencies":{"@opentelemetry/api":"^1.3.0"},"_npmOperationalInternal":{"tmp":"tmp/instrumentation-knex_0.68.0_1792530855078_0.9463357573581588","host":"s3://npm-registry-packages-npm-production"},"readme":"# OpenTelemetry Knex 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 [`knex`](https://github.com/knex/knex) module. This module allows the user to automatically collect trace data and export them to their backend of choice.\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-knex\n```\n\n### Supported Versions\n\n- [`knex`](https://www.npmjs.com/package/knex) versions `>=0.10.0 <4`\n\n## Usage\n\n```js\nconst { NodeSDK } = require('@opentelemetry/sdk-node');\nconst { KnexInstrumentation } = require('@opentelemetry/instrumentation-knex');\n\nconst sdk = new NodeSDK({\n  instrumentations: [\n    new KnexInstrumentation({\n      // See below for configuration options.\n    }),\n  ],\n});\nsdk.start();\nprocess.once('beforeExit', async () => { await sdk.shutdown(); });\n```\n\n### Configuration Options\n\n| Options | Type | Example | Description |\n| ------- | ---- | ------- | ----------- |\n| `maxQueryLength` | `number` | `100` | Truncate `db.query.text` attribute to a maximum length. If the statement is truncated `'..'` is added to its end. Default `1022`. `-1` leaves `db.query.text` untouched. |\n| `requireParentSpan` | `boolean` | `false` | Don't create spans unless they are part of an existing trace. Default is `false`. |\n\n## Semantic Conventions\n\nThis instrumentation creates spans with database-related attributes.\n\nThe `instrumentation-knex` versions 0.64.0 and later emit the stable v1.33.0+ semantic conventions.\n\n| Attribute              | Short Description                                                           |\n| ---------------------- | --------------------------------------------------------------------------- |\n| `db.collection.name`   | The name of the primary table that the operation is acting upon.            |\n| `db.namespace`         | The name of the database being accessed.                                    |\n| `db.operation.name`    | The name of the operation being executed.                                   |\n| `db.query.text`        | The database statement being executed.                                      |\n| `db.system.name`       | An identifier for the database management system (DBMS) product being used. |\n| `server.address`       | Remote hostname or similar.                                                 |\n| `server.port`          | Remote port number.                                                         |\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-knex\n[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Finstrumentation-knex.svg\n","publish_time":1792530855162,"_cnpm_publish_time":1792530855162,"dist-tags":{"latest":"0.69.0"}}