{"_id":"@byndyusoft/nest-opentelemetry-configurator","_rev":"2-57e3f477c3e6cbc8b8bafeffbeeb8300","name":"@byndyusoft/nest-opentelemetry-configurator","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@byndyusoft/nest-opentelemetry-configurator","version":"1.0.0","author":{"name":"Byndyusoft"},"license":"Apache-2.0","_id":"@byndyusoft/nest-opentelemetry-configurator@1.0.0","maintainers":[{"name":"alexanderbyndyu","email":"alexander.byndyu@yandex.ru"},{"name":"sadcitizen","email":"sadcitizen@yandex.ru"},{"name":"dmitriy.litichevskiy","email":"litichevskiydv@gmail.com"},{"name":"razonrus","email":"iruslansafin@gmail.com"}],"homepage":"https://github.com/Byndyusoft/nest-opentelemetry-configurator#readme","bugs":{"url":"https://github.com/Byndyusoft/nest-opentelemetry-configurator/issues"},"dist":{"shasum":"07277ff13f4b2816040bc5fa8dacb79436e39b28","tarball":"https://registry.npmjs.org/@byndyusoft/nest-opentelemetry-configurator/-/nest-opentelemetry-configurator-1.0.0.tgz","fileCount":33,"integrity":"sha512-ow39KVMsi6EveudoopQr3TmTrS8yp+k3OnigNzU/XKPqOdLSp/1z1nfGTHvoRHXqi9FmYAkCiDTK55CgDtoOww==","signatures":[{"sig":"MEUCIClegEn/n2ShzSFzRCP24vGNo8H7lKuxJ0aamWKLYllcAiEA3KKcSUOL4pRbuCdA29Zk931hbWiIJvkJp0GFWWr9Zv0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42316},"jest":{"roots":["<rootDir>/src"],"testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.ts$":"ts-jest"},"resetMocks":true,"testEnvironment":"node","coverageDirectory":"<rootDir>/coverage","coverageReporters":["lcov","text"],"setupFilesAfterEnv":["jest-extended/all"],"collectCoverageFrom":["./src/**/*.ts","!**/index.ts"],"moduleFileExtensions":["ts","js"]},"main":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=14"},"gitHead":"055d6747ede949089adf41ad28812dffc1a1bb27","scripts":{"lint":"yarn run lint:eslint && yarn run lint:markdown && yarn run lint:prettier","test":"jest","build":"yarn run prebuild && yarn run build:src","lint:fix":"yarn run lint:eslint:fix && yarn run lint:markdown:fix && yarn run lint:prettier:fix","prebuild":"shx rm -rf ./dist","test:cov":"jest --coverage","build:src":"tsc --project ./tsconfig.build.json","lint:eslint":"eslint --ignore-path ./.gitignore --max-warnings 0 --ext .ts,.js .","postpublish":"pinst --enable","_postinstall":"husky install","lint:markdown":"markdownlint --ignore-path ./.gitignore \"./**/*.md\"","lint:prettier":"prettier --ignore-path ./.gitignore --check \"./**/*.{ts,js,json,yaml,yml,md}\"","prepublishOnly":"pinst --disable","lint:eslint:fix":"eslint --ignore-path ./.gitignore --fix --ext .ts,.js .","lint:markdown:fix":"markdownlint --ignore-path ./.gitignore --fix \"./**/*.md\"","lint:prettier:fix":"prettier --ignore-path ./.gitignore --write \"./**/*.{ts,js,json,yaml,yml,md}\""},"_npmUser":{"name":"alexanderbyndyu","email":"alexander.byndyu@yandex.ru"},"repository":{"url":"git+https://github.com/Byndyusoft/nest-opentelemetry-configurator.git","type":"git"},"_npmVersion":"8.19.3","description":"Nest.js opentelemtry configurator","directories":{},"_nodeVersion":"20.11.0","dependencies":{"tslib":"^2.4.0","opentracing":"0.14.7","@opentelemetry/api":"1.6.0","@opentelemetry/core":"1.17.0","@opentelemetry/sdk-node":"0.43.0","@opentelemetry/sdk-trace-base":"1.17.0","@opentelemetry/shim-opentracing":"1.17.0","@opentelemetry/propagator-jaeger":"1.17.0","@opentelemetry/context-async-hooks":"1.17.0","@opentelemetry/instrumentation-http":"0.43.0","@opentelemetry/exporter-trace-otlp-http":"0.43.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"yarn@4.0.0-rc.34","devDependencies":{"shx":"0.3.4","jest":"29.3.1","rxjs":"^7.8.0","husky":"8.0.2","pinst":"3.0.0","eslint":"8.30.0","express":"4.17.3","ts-jest":"29.0.3","prettier":"2.8.1","typescript":"4.9.4","@types/jest":"29.2.4","@types/node":"16.18.10","lint-staged":"13.1.0","@nestjs/core":"^9.4.3","jest-extended":"3.2.0","@nestjs/common":"^9.4.3","@types/express":"4.17.21","@commitlint/cli":"17.3.0","markdownlint-cli":"0.32.2","reflect-metadata":"0.2.1","semantic-release":"19.0.5","@byndyusoft/tsconfig":"1.2.0","@byndyusoft/eslint-config":"2.5.0","prettier-plugin-packagejson":"2.3.0","@commitlint/config-conventional":"17.3.0"},"peerDependencies":{"rxjs":"^7.8.0","@nestjs/core":"^9.4.3","@nestjs/common":"^9.4.3"},"_npmOperationalInternal":{"tmp":"tmp/nest-opentelemetry-configurator_1.0.0_1707409701601_0.44121192462919545","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-02-08T16:28:21.488Z","modified":"2026-10-02T16:10:06.433Z","1.0.0":"2024-02-08T16:28:21.794Z"},"bugs":{"url":"https://github.com/Byndyusoft/nest-opentelemetry-configurator/issues"},"author":{"name":"Byndyusoft"},"license":"Apache-2.0","homepage":"https://github.com/Byndyusoft/nest-opentelemetry-configurator#readme","repository":{"url":"git+https://github.com/Byndyusoft/nest-opentelemetry-configurator.git","type":"git"},"description":"Nest.js opentelemtry configurator","maintainers":[{"email":"alexander.byndyu@yandex.ru","name":"alexanderbyndyu"},{"email":"sadcitizen@yandex.ru","name":"sadcitizen"},{"email":"iruslansafin@gmail.com","name":"razonrus"}],"readme":"# nest-opentelemetry-configurator\n\nOpentelemetry tracing module for Nest.js services\n\n## Repo\n\nStructure is described in root [package.json](./package.json) and contains the following packages:\n\n- [opentelemetryConfigurator](./packages/nest-opentelemetry-configurator) - tracing module\n\n## Prerequisites\n\nMake sure you have installed all of the following prerequisites on your development machine:\n\n- [Git](https://git-scm.com)\n- [Node.js](https://nodejs.org) (version 16 LTS or higher)\n- [Yarn](https://yarnpkg.com) package manager\n\n## Code conventions\n\nSome code conventions are enforced automatically by ESLint + Prettier + markdownlint + husky + lint-staged stack.\n\n## Service development lifecycle\n\n- Implement business logic\n- Add or adapt unit-tests (prefer before and simultaneously with coding)\n- Add or change the documentation as needed\n- Open pull request in the correct branch. Target the project's `master` branch\n\n## Usage\n\n1. Import module in `main.ts`\n\n   ```typescript\n   import { OpenTelemetryConfigurator } from \"@byndyusoft/opentelemetry-configurator\";\n   ```\n\n2. Call setup method before creating app with options\n\n   IMPORTANT! Setup method has to be called before importing http module. This means that there should be no `http` module import in the `main.ts`\n\n   ```typescript\n   async function bootstrap(): Promise<void> {\n     await OpenTelemetryConfigurator.setup({\n       serviceName: \"service name\",\n       exporterUrl: \"http://jaeger_host:4318/v1/traces\",\n       ignoreUrls: [\"_healthz\", \"_readiness\", \"metrics\", \"engine-rest/external-task/fetchAndLock\"], // Optional. Default values\n     });\n\n     const app = (await NestFactory.create)<NestExpressApplication>(await AppModule.register(), {\n       bufferLogs: true,\n     });\n     //  ...\n   }\n   ```\n\n3. Add `TracingInterceptor` for controllers.\n\n   By default `TracingInterceptor` set span name from route of controller method.\n   If you need to change the span name use a decorator `SpanName`\n\n   ```typescript\n   import { SpanName, TracingInterceptor } from \"@byndyusoft/nest-opentelemetry-configurator\";\n\n   @UseInterceptors(TracingInterceptor)\n   export class AppController {\n     // Span name is /returns/{returnId}\n     @Get(\"/returns/:returnId\")\n     public async get(/*...*/) {\n       //....\n     }\n\n     // Span name is customName\n     @SpanName(\"customName\")\n     @Post(\"/returns/:returnId\")\n     public async update(/*...*/) {\n       //....\n     }\n   }\n   ```\n","readmeFilename":"README.md"}