{"name":"@opentelemetry/instrumentation-mongoose","version":"0.60.0","keywords":["mongodb","mongoose","orm","instrumentation","nodejs","opentelemetry","tracing"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/instrumentation-mongoose@0.60.0","maintainers":[{"name":"dyladan","email":"dyladan@gmail.com"},{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"npmjs-account","email":"npmjs-account@opentelemetry.io"},{"name":"trentm","email":"trentm@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-mongoose#readme","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js-contrib/issues"},"dist":{"shasum":"9481a90d3f75d66244d7f63709529cb7f2823103","tarball":"http://registry-npm.ywwl.com/@opentelemetry/instrumentation-mongoose/download/@opentelemetry/instrumentation-mongoose-0.60.0.tgz","fileCount":21,"integrity":"sha512-8BahAZpKsOoc+lrZGb7Ofn4g3z8qtp5IxDfvAVpKXsEheQN7ONMH5djT5ihy6yf8yyeQJGS0gXFfpEAEeEHqQg==","signatures":[{"sig":"MEUCIHoK5ooiU3I2HmtHz+7zSBtY5afZELT8aP/oco4EBfQ7AiEA4Qo7/vN+OjMxnEg99lul14BkYdW42hKwjNvZBPLfifI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@opentelemetry%2finstrumentation-mongoose@0.60.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":111265,"size":23569,"noattachment":false,"key":"/@opentelemetry/instrumentation-mongoose/-/@opentelemetry/instrumentation-mongoose-0.60.0.tgz"},"main":"build/src/index.js","types":"build/src/index.d.ts","engines":{"node":"^18.19.0 || >=20.6.0"},"gitHead":"ed97091c9890dd18e52759f2ea98e9d7593b3ae4","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","test":"npm run test-v7-v9","clean":"rimraf build/*","compile":"tsc -p .","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"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:95246b89-7dfb-46df-8a5a-e9345af149d9"}},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js-contrib.git","type":"git","directory":"packages/instrumentation-mongoose"},"_npmVersion":"lerna/9.0.5/node@v24.14.0+x64 (linux)","description":"OpenTelemetry instrumentation for `mongoose` database object data modeling (ODM) library for MongoDB","directories":{},"_nodeVersion":"24.14.0","dependencies":{"@opentelemetry/core":"^2.0.0","@opentelemetry/instrumentation":"^0.214.0","@opentelemetry/semantic-conventions":"^1.33.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mongoose":"^9.1.5","@opentelemetry/api":"^1.3.0","@opentelemetry/sdk-trace-base":"^2.0.0","@opentelemetry/contrib-test-utils":"^0.61.0"},"peerDependencies":{"@opentelemetry/api":"^1.3.0"},"_npmOperationalInternal":{"tmp":"tmp/instrumentation-mongoose_0.60.0_1774484677624_0.31532554207420405","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.\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":1774484677752,"_cnpm_publish_time":1774484677752,"dist-tags":{"latest":"0.71.0"}}