{"name":"@opentelemetry/instrumentation-nestjs-core","version":"0.49.0","keywords":["instrumentation","nestjs","nestjs-core","nodejs","opentelemetry","profiling","tracing"],"author":"OpenTelemetry Authors","license":"Apache-2.0","_id":"@opentelemetry/instrumentation-nestjs-core@0.49.0","maintainers":[{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"},{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-nestjs-core#readme","dist":{"shasum":"a79428e72c14250c44913a3a57f39c7297aab013","tarball":"http://registry-npm.ywwl.com/@opentelemetry/instrumentation-nestjs-core/download/@opentelemetry/instrumentation-nestjs-core-0.49.0.tgz","fileCount":21,"integrity":"sha512-1R/JFwdmZIk3T/cPOCkVvFQeKYzbbUvDxVH3ShXamUwBlGkdEu5QJitlRMyVNZaHkKZKWgYrBarGQsqcboYgaw==","signatures":[{"sig":"MEQCIBV1ksUeT0BUdj8v2QSc0nt88SczgKxfZELemNjFpuBBAiAin+SNR8wcUQdauwtZXAaMTsb60mft/jKL91gZPCwU+Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@opentelemetry%2finstrumentation-nestjs-core@0.49.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":52229,"size":12706,"noattachment":false,"key":"/@opentelemetry/instrumentation-nestjs-core/-/@opentelemetry/instrumentation-nestjs-core-0.49.0.tgz"},"main":"build/src/index.js","types":"build/src/index.d.ts","engines":{"node":"^18.19.0 || >=20.6.0"},"gitHead":"e7960a2061c0a039ffa57ed8dbb73d605d65f4f6","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"npm run test-required-node-version && nyc mocha --timeout 5000 'test/**/*.test.ts' || echo 'Node version is not supported for testing'","clean":"rimraf build/*","compile":"tsc -p .","lint:fix":"eslint . --ext .ts --fix","setup:dev":"nx run-many -t compile -p @opentelemetry/instrumentation-nestjs-core","compile:watch":"tsc -w","prepublishOnly":"npm run compile","version:update":"node ../../scripts/version-update.js","test-all-versions":"tav","test-required-node-version":"node -e \"process.exit(parseInt(process.versions.node.split('.')[0], 10) >= 15 ? 0 : 1)\""},"_npmUser":{"name":"dyladan","actor":{"name":"dyladan","type":"user","email":"dyladan@gmail.com"},"email":"dyladan@gmail.com"},"repository":{"url":"https://github.com/open-telemetry/opentelemetry-js-contrib.git","type":"git","directory":"packages/instrumentation-nestjs-core"},"_npmVersion":"lerna/8.2.3/node@v18.20.8+x64 (linux)","description":"OpenTelemetry instrumentation for NestJS server side applications framework","directories":{},"_nodeVersion":"18.20.8","dependencies":{"@opentelemetry/instrumentation":"^0.203.0","@opentelemetry/semantic-conventions":"^1.30.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"17.1.0","rxjs":"7.8.2","rimraf":"5.0.10","semver":"7.7.2","cross-env":"7.0.3","typescript":"5.0.4","@types/node":"18.18.14","rxjs-compat":"6.6.7","@nestjs/core":"11.0.10","@types/mocha":"10.0.10","@types/semver":"7.5.8","@nestjs/common":"11.0.10","reflect-metadata":"0.2.2","test-all-versions":"6.1.0","@opentelemetry/api":"^1.3.0","@nestjs/platform-express":"11.0.10","@opentelemetry/sdk-trace-base":"^2.0.0","@opentelemetry/sdk-trace-node":"^2.0.0","@opentelemetry/context-async-hooks":"^2.0.0"},"peerDependencies":{"@opentelemetry/api":"^1.3.0"},"_npmOperationalInternal":{"tmp":"tmp/instrumentation-nestjs-core_0.49.0_1752077452243_0.7163350599904594","host":"s3://npm-registry-packages-npm-production"},"readme":"# OpenTelemetry NestJS 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 [Nest framework][pkg-web-url] 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-nestjs-core\n```\n\n### Supported Versions\n\n- [`@nestjs/core`](https://www.npmjs.com/package/@nestjs/core) versions `>=4.0.0 <12`\n\n## Usage\n\nOpenTelemetry Nest Instrumentation allows the user to automatically collect trace data from the controller handlers and export them to the backend of choice.\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 { NestInstrumentation } = require('@opentelemetry/instrumentation-nestjs-core');\n\nconst sdk = new NodeSDK({\n  instrumentations: [\n    new NestInstrumentation(),\n  ],\n});\nsdk.start();\nprocess.once('beforeExit', async () => { await sdk.shutdown(); });\n```\n\n## Emitted Spans\n\n| Name                            | `nestjs.type`     | Description                                                                | Included attributes         |\n|---------------------------------|-------------------|----------------------------------------------------------------------------|-----------------------------|\n| `Create Nest App`               | `app_creation`    | Traces the bootup for the Nest App. The `NestFactory(Static).create` call. | `nestjs.module`             |\n| `<ControllerName>.<memberName>` | `request_context` | Traces the whole request context.                                          | `http.*`, `nestjs.callback` |\n| `<memberName>`                  | `handler`         | Traces the work of a specific controller member function.                  | `nestjs.callback`           |\n\n## Semantic Conventions\n\nThis instrumentation creates spans with attributes from the HTTP and NestJS semantic conventions.\n\nThe `instrumentation-nestjs-core` versions 0.66.0 and later emit the stable v1.23.0+ semantic conventions.\n\nAttributes collected:\n\n| Attribute             | Short Description                                                 |\n|-----------------------|-------------------------------------------------------------------|\n| `component`*          | \"@nestjs/core\"                                                    |\n| `nestjs.version`*     | Version of instrumented `@nestjs/core` package                    |\n| `nestjs.type`*        | See [NestType](./src/enums/NestType.ts)                           |\n| `nestjs.module`       | Nest module class name                                            |\n| `nestjs.controller`   | Nest controller class name                                        |\n| `nestjs.callback`     | The function name of the member in the controller                 |\n| `http.route`          | Route assigned to handler. Ex: `/users/:id`                       |\n| `http.request.method` | HTTP method.                                                      |\n| `url.full`            | Full request URL.                                                 |\n\n\\* included in all of the spans.\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-nestjs-core\n[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Finstrumentation-nestjs-core.svg\n[pkg-web-url]: https://nestjs.com/\n","publish_time":1752077452453,"_cnpm_publish_time":1752077452453,"dist-tags":{"latest":"0.72.0"}}