{"_id":"@opentelemetry/instrumentation-knex@0.69.0","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js-contrib/issues"},"dist":{"shasum":"4eeae07c368aa6671397af76f610499797b8ac01","tarball":"http://registry-npm.ywwl.com/@opentelemetry/instrumentation-knex/download/@opentelemetry/instrumentation-knex-0.69.0.tgz","fileCount":36,"integrity":"sha512-8L/N49vDiReaX+CcF4kQt86Xhma2N459NIkYnGgCzUfcjtpxuwheBzekXUDBb9NSq+QItriJOzyZKya6CsJi4A==","signatures":[{"sig":"MEQCIBbtfUlGiDPbLJBGhjLqxFlcAyBjqTmx/4vhxNdUU4NeAiAfApbe/ZQa0qfauZ/o+BrtiT1HLXHbReoxTycthXhStw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFPouV3vqMYsfza9gqFY1hbLZxdytpAhXRrSU9SF13MSAiEAocGN/q0JdItmfra06b6Epjq21S77XbISP7f5wL6Rdrw="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@opentelemetry%2finstrumentation-knex@0.69.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":76294,"size":17898,"noattachment":false,"key":"/@opentelemetry/instrumentation-knex/-/@opentelemetry/instrumentation-knex-0.69.0.tgz"},"main":"./dist/index.cjs","name":"@opentelemetry/instrumentation-knex","types":"./dist/index.d.cts","author":{"name":"OpenTelemetry Authors"},"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":"fc3b13eb41e9512fb0d769b431583f90b5ef8326","license":"Apache-2.0","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"},"version":"0.69.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"1be76e11-41c4-4947-9b6b-3016687478e3"}},"homepage":"https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-knex#readme","keywords":["instrumentation","knex","nodejs","opentelemetry","tracing"],"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.22.2+x64 (linux)","description":"OpenTelemetry instrumentation for `knex` database SQL query builder","directories":{},"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"}],"_nodeVersion":"24.22.2","dependencies":{"@opentelemetry/instrumentation":"^0.301.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.10.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/instrumentation-knex_0.69.0_1793914570094_0.1336780203684742"},"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":1793914570191,"_cnpm_publish_time":1793914570191,"dist-tags":{"latest":"0.69.0"}}