{"_id":"@opentelemetry/instrumentation-mongoose@0.71.0","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js-contrib/issues"},"dist":{"shasum":"2a5cfbdeb55d240ec87d784f742a5f808fc20aae","tarball":"http://registry-npm.ywwl.com/@opentelemetry/instrumentation-mongoose/download/@opentelemetry/instrumentation-mongoose-0.71.0.tgz","fileCount":31,"integrity":"sha512-Pua7hHiaUXFig3sXrAmT+nZBASbZf8iTMyU3gEowSq/QYDKSZVmIHXRUmfkQPp3ctCz8vFAvALJLHP/NpSgUkw==","signatures":[{"sig":"MEUCIAGghjwuld+95SGUO1MYtGJtZc0zglMZXJl73em3N23lAiEAkNId5ka39Bmuyi70m95GcPzFnBDZuTfiAiQjSVKumTA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDzNx3jUl0FR3MnRn8XetqqFfZi8Ky3e+cpeIvQVCqayQIhAJy2mfJxdaYokxAhveNU1witBJBwafRLGAIq6Vi96GkI"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@opentelemetry%2finstrumentation-mongoose@0.71.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":118670,"size":21709,"noattachment":false,"key":"/@opentelemetry/instrumentation-mongoose/-/@opentelemetry/instrumentation-mongoose-0.71.0.tgz"},"main":"./dist/index.cjs","name":"@opentelemetry/instrumentation-mongoose","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":"npm run test-v7-v9","clean":"rimraf dist build","compile":"tsdown","test-v5-v6":"nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v5-v6.test.ts'","test-v7-v9":"nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v7-v9.test.ts'","lint:readme":"node ../../scripts/lint-readme.js","prepublishOnly":"npm run compile","version:update":"node ../../scripts/version-update.js","test-services:ls":"echo mongodb","test-all-versions":"tav","test-services:stop":"cd ../.. && npm run test-services:stop mongodb","test-services:start":"cd ../.. && npm run test-services:start mongodb","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-mongoose","test-all-versions:with-services-env":"cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm run test-all-versions"},"version":"0.71.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"95246b89-7dfb-46df-8a5a-e9345af149d9"}},"homepage":"https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-mongoose#readme","keywords":["mongodb","mongoose","orm","instrumentation","nodejs","opentelemetry","tracing"],"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js-contrib.git","type":"git","directory":"packages/instrumentation-mongoose"},"_npmVersion":"lerna/9.0.7/node@v24.22.2+x64 (linux)","description":"OpenTelemetry instrumentation for `mongoose` database object data modeling (ODM) library for MongoDB","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/core":"^3.0.0","@opentelemetry/instrumentation":"^0.301.0","@opentelemetry/semantic-conventions":"^1.33.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mongoose":"^9.1.5","@opentelemetry/api":"^1.10.0","@opentelemetry/sdk-trace":"^3.0.0","@opentelemetry/contrib-test-utils":"^0.72.0"},"peerDependencies":{"@opentelemetry/api":"^1.10.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/instrumentation-mongoose_0.71.0_1793914622089_0.6953973230013697"},"readme":"# OpenTelemetry mongoose 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 [`mongoose`](https://github.com/Automattic/mongoose) 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-mongoose\n```\n\n## Supported Versions\n\n- [`mongoose`](https://www.npmjs.com/package/mongoose) versions `>=5.9.7 <10`\n\n## Usage\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 { MongooseInstrumentation } = require('@opentelemetry/instrumentation-mongoose');\n\nconst sdk = new NodeSDK({\n  instrumentations: [\n    new MongooseInstrumentation(),\n  ],\n});\nsdk.start();\nprocess.once('beforeExit', async () => { await sdk.shutdown(); });\n```\n\n## Semantic Conventions\n\nThis instrumentation uses Semantic Conventions for database calls and network.\n\nThe `instrumentation-mongoose` versions 0.66.0 and later emit the stable v1.33.0+ semantic conventions.\n\n| Attribute            | Description                                                                                  |\n| -------------------- | -------------------------------------------------------------------------------------------- |\n| `db.system.name`     | An identifier for the database management system (DBMS) product being used. Value: 'mongodb' |\n| `db.collection.name` | The collection being accessed within the database.                                           |\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 (only set when `dbStatementSerializer` is configured). |\n| `server.address`     | Remote hostname or similar.                                                                  |\n| `server.port`        | Remote port number.                                                                          |\n\nSpan name format: `{operation} {collection}` (e.g., `save users`)\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-mongoose\n[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Finstrumentation-mongoose.svg\n","publish_time":1793914622170,"_cnpm_publish_time":1793914622170,"dist-tags":{"latest":"0.71.0"}}