{"_id":"@opentelemetry/instrumentation-mysql@0.68.0","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js-contrib/issues"},"dist":{"shasum":"1b4b26838cfe6523553226fcbd506a0683c342a0","tarball":"http://registry-npm.ywwl.com/@opentelemetry/instrumentation-mysql/download/@opentelemetry/instrumentation-mysql-0.68.0.tgz","fileCount":24,"integrity":"sha512-N6TCMiWmisdG9DzSuMHxZ+N5qD3meoCy70mVE6fneZj6M24EXj86e56BzLFQ8Pkd6BgaPBJcdMTT/GBfPuW15w==","signatures":[{"sig":"MEYCIQCo0mSBckVLMksAnNRSql3urYJAX1V/qQOw3Ka9fNskLgIhAKvfhcHK2OycKESLu6G41hN8uVuqJjAZwohnwbG1f37v","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIA+g3Ln+exu2j4XGYwDS9sxmJDSem7Leeo6Ya/mg5GXDAiEAxl56dKE92RSJwoOj9S8C2nBZv7n4Y6hdKpmzvM/OJP8="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@opentelemetry%2finstrumentation-mysql@0.68.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":73683,"size":18351,"noattachment":false,"key":"/@opentelemetry/instrumentation-mysql/-/@opentelemetry/instrumentation-mysql-0.68.0.tgz"},"main":"build/src/index.js","name":"@opentelemetry/instrumentation-mysql","types":"build/src/index.d.ts","author":{"name":"OpenTelemetry Authors"},"engines":{"node":"^18.19.0 || >=20.6.0"},"gitHead":"932fc967b142a8eb47d306fe92107b62962099f0","license":"Apache-2.0","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","test":"nyc --no-clean mocha 'test/**/*.test.ts'","clean":"rimraf build/*","//todo":"echo \"add test-all-versions\"","compile":"tsc -p .","prepublishOnly":"npm run compile","version:update":"node ../../scripts/version-update.js","test-services:ls":"echo mysql","test-services:stop":"cd ../.. && npm run test-services:stop mysql","test-services:start":"cd ../.. && npm run test-services:start mysql","test:with-services-env":"cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test","compile:with-dependencies":"nx run-many -t compile -p @opentelemetry/instrumentation-mysql"},"version":"0.68.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:9b5002af-f604-42ef-8df2-a62c9166c4d3"}},"homepage":"https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-mysql#readme","keywords":["instrumentation","mysql","nodejs","opentelemetry","profiling","tracing"],"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js-contrib.git","type":"git","directory":"packages/instrumentation-mysql"},"_npmVersion":"lerna/9.0.7/node@v24.19.0+x64 (linux)","description":"OpenTelemetry instrumentation for `mysql` database client for MySQL","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.19.0","dependencies":{"@opentelemetry/instrumentation":"^0.222.0","@opentelemetry/semantic-conventions":"^1.33.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mysql":"2.18.1","@types/mysql":"2.15.27","@opentelemetry/api":"^1.3.0","@opentelemetry/sdk-trace":"^2.9.0","@opentelemetry/sdk-metrics":"^2.9.0","@opentelemetry/contrib-test-utils":"^0.69.0","@opentelemetry/context-async-hooks":"^2.9.0"},"peerDependencies":{"@opentelemetry/api":"^1.3.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/instrumentation-mysql_0.68.0_1788208781327_0.4973124543142149"},"readme":"# OpenTelemetry MySQL 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 [`mysql`](https://www.npmjs.com/package/mysql) module.\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-mysql\n```\n\n## Supported Versions\n\n- [`mysql`](https://www.npmjs.com/package/mysql) versions `>=2.0.0 <3`\n\n## Usage\n\nOpenTelemetry MySQL Instrumentation allows the user to automatically collect trace data and export them to the backend of choice, to give observability to distributed systems when working with [mysql](https://www.npmjs.com/package/mysql).\n\nTo enable a specific instrumentation, pass it to `registerInstrumentations()`.\nThis is commonly done via `NodeSDK` for fully setting up all OpenTelemetry SDK components:\n\n```js\nconst { NodeSDK } = require('@opentelemetry/sdk-node');\nconst { MySQLInstrumentation } = require('@opentelemetry/instrumentation-mysql');\n\nconst sdk = new NodeSDK({\n  instrumentations: [\n    new MySQLInstrumentation(),\n  ],\n});\nsdk.start();\nprocess.once('beforeExit', async () => { await sdk.shutdown(); });\n```\n\nSee [examples/mysql](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/examples/mysql) for a short example.\n\n### MySQL instrumentation Options\n\n| Options                                           | Type      | Default | Description |\n| ------------------------------------------------- | --------- | ------- | ----------- |\n| [`enhancedDatabaseReporting`](./src/types.ts#L24) | `boolean` | `false` | If true, a `db.mysql.values` attribute containing the query's parameters will be add to database spans. Note that this is not an attribute defined in [Semantic Conventions](https://opentelemetry.io/docs/specs/semconv/database/mysql/). |\n\n## Semantic Conventions\n\nThe `instrumentation-mysql` versions 0.66.0 and later emit the stable v1.33.0+ semantic conventions.\n\nAttributes collected:\n\n| Attribute        | Description |\n| ---------------- | ----------- |\n| `db.system.name` | The database system. Always `'mysql'`. |\n| `db.namespace`   | The database associated with the connection, as provided at connection time. (This does not track changes made via `SELECT DATABASE()`.) |\n| `db.query.text`  | The database query being executed. |\n| `server.address` | Remote hostname or similar. |\n| `server.port`    | Remote port number. |\n\nMetrics collected:\n\n- [`db.client.connection.count`](https://opentelemetry.io/docs/specs/semconv/database/database-metrics/#metric-dbclientconnectioncount) - The number of connections currently in a given state.\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-mysql\n[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Finstrumentation-mysql.svg\n","publish_time":1788208781428,"_cnpm_publish_time":1788208781428,"dist-tags":{"latest":"0.71.0"}}