{"name":"@opentelemetry/instrumentation-mongoose","version":"0.46.1","keywords":["mongodb","mongoose","orm","instrumentation","nodejs","opentelemetry","tracing"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/instrumentation-mongoose@0.46.1","homepage":"https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/instrumentation-mongoose#readme","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js-contrib/issues"},"dist":{"shasum":"23f22b7d4d5a548ac8add2a52ec2fec4e61c7de1","tarball":"http://registry-npm.ywwl.com/@opentelemetry/instrumentation-mongoose/download/@opentelemetry/instrumentation-mongoose-0.46.1.tgz","fileCount":18,"integrity":"sha512-3kINtW1LUTPkiXFRSSBmva1SXzS/72we/jL22N+BnF3DFcoewkdkHPYOIdAAk9gSicJ4d5Ojtt1/HeibEc5OQg==","signatures":[{"sig":"MEYCIQDd3ghFKbO1UpIzH/h0dCD4tQ+v15ovk9ofOHzji1oW+gIhAOwcwAkXXCjFcIy8664CdzYugEhfSwg8vpRiQ1g+MhzZ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@opentelemetry%2finstrumentation-mongoose@0.46.1","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":68485,"size":15700,"noattachment":false,"key":"/@opentelemetry/instrumentation-mongoose/-/@opentelemetry/instrumentation-mongoose-0.46.1.tgz"},"main":"build/src/index.js","types":"build/src/index.d.ts","engines":{"node":">=14"},"gitHead":"1eb77007669bae87fe5664d68ba6533b95275d52","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"npm run test-v5-v6","clean":"rimraf build/*","compile":"tsc -p .","lint:fix":"eslint . --ext .ts --fix","prewatch":"npm run precompile","test-v5-v6":"nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v5-v6.test.ts'","test-v7-v8":"nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v7-v8.test.ts'","lint:readme":"node ../../../scripts/lint-readme.js","docker:start":"docker run -e MONGODB_DB=opentelemetry-tests -e MONGODB_PORT=27017 -e MONGODB_HOST=127.0.0.1 -p 27017:27017 --rm mongo","prepublishOnly":"npm run compile","version:update":"node ../../../scripts/version-update.js","test-all-versions":"tav"},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js-contrib.git","type":"git"},"_npmVersion":"lerna/6.6.2/node@v18.20.6+x64 (linux)","description":"OpenTelemetry instrumentation for `mongoose` database object data modeling (ODM) library for MongoDB","directories":{},"_nodeVersion":"18.20.6","dependencies":{"@opentelemetry/core":"^1.8.0","@opentelemetry/instrumentation":"^0.57.1","@opentelemetry/semantic-conventions":"^1.27.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","expect":"29.2.0","rimraf":"5.0.10","mongoose":"6.13.8","typescript":"4.4.4","@types/node":"18.18.14","@types/mocha":"8.2.3","test-all-versions":"6.1.0","@opentelemetry/api":"^1.3.0","@opentelemetry/sdk-trace-base":"^1.8.0","@opentelemetry/contrib-test-utils":"^0.45.1"},"peerDependencies":{"@opentelemetry/api":"^1.3.0"},"_npmOperationalInternal":{"tmp":"tmp/instrumentation-mongoose_0.46.1_1739984918486_0.05638310631999688","host":"s3://npm-registry-packages-npm-production"},"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, 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-mongoose\n```\n\n## Supported Versions\n\n- [`mongoose`](https://www.npmjs.com/package/mongoose) versions `>=5.9.7 <9`\n\n## Usage\n\nTo load a specific plugin, specify it in the registerInstrumentations's configuration:\n\n```js\nconst { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');\nconst { MongooseInstrumentation } = require('@opentelemetry/instrumentation-mongoose');\nconst { registerInstrumentations } = require('@opentelemetry/instrumentation');\n\nconst provider = new NodeTracerProvider();\nprovider.register();\n\nregisterInstrumentations({\n  instrumentations: [\n    new MongooseInstrumentation(),\n  ],\n})\n```\n\n## Semantic Conventions\n\nThis package uses `@opentelemetry/semantic-conventions` version `1.22+`, which implements Semantic Convention [Version 1.7.0](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/semantic_conventions/README.md)\n\nAttributes collected:\n\n| Attribute               | Short Description                                                           |\n| ----------------------- | --------------------------------------------------------------------------- |\n| `db.mongodb.collection` | The collection being accessed within the database stated in `db.name`.      |\n| `db.name`               | This attribute is used to report the name of the database being accessed.   |\n| `db.operation`          | The name of the operation being executed, or the SQL keyword.               |\n| `db.statement`          | The database statement being executed.                                      |\n| `db.system`             | An identifier for the database management system (DBMS) product being used. |\n| `db.user`               | Username for accessing the database.                                        |\n| `net.peer.name`         | Remote hostname or similar.                                                 |\n| `net.peer.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-mongoose\n[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Finstrumentation-mongoose.svg\n","publish_time":1739984918655,"maintainers":[{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"},{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"}],"_cnpm_publish_time":1739984918655,"dist-tags":{"latest":"0.71.0"}}