From 46c2df35a99810931f13a689c6e80b6135f4958c Mon Sep 17 00:00:00 2001 From: Ivan Santos <301291+pragmaticivan@users.noreply.github.com> Date: Sat, 26 Nov 2022 22:20:04 -0600 Subject: [PATCH] feat!: updates to latest metric sdk and drop node-sdk dependency --- README.md | 4 +- package-lock.json | 675 ++---------------- package.json | 9 +- .../opentelemetry-options.interface.ts | 2 +- src/metrics/decorators/common.ts | 2 +- src/metrics/decorators/counter.ts | 2 +- src/metrics/decorators/histogram.ts | 2 +- src/metrics/decorators/observable.ts | 2 +- src/metrics/metric-data.ts | 7 +- src/metrics/metric.service.ts | 4 +- src/middleware/api-metrics.middleware.ts | 2 +- src/opentelemetry-core.module.ts | 2 +- src/tracing/decorators/span.spec.ts | 11 +- tests/e2e/metrics/decorators/common.spec.ts | 51 +- tests/e2e/metrics/metric.service.spec.ts | 48 +- .../middleware/api-metrics.middleware.spec.ts | 2 +- 16 files changed, 146 insertions(+), 679 deletions(-) diff --git a/README.md b/README.md index 20e8fee..f5e64c6 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,7 @@ export class BookService { ```ts import { MetricService } from 'nestjs-otel'; -import { Counter } from '@opentelemetry/api-metrics'; +import { Counter } from '@opentelemetry/api'; @Injectable() export class BookService { @@ -247,7 +247,7 @@ Example of usage: ```ts import { OtelCounter } from 'nestjs-otel'; -import { Counter } from '@opentelemetry/api-metrics'; +import { Counter } from '@opentelemetry/api'; @Controller() export class AppController { diff --git a/package-lock.json b/package-lock.json index f6d33a0..283eadb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,9 +9,9 @@ "version": "4.0.1", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/api": "^1.2.0", + "@opentelemetry/api": "^1.3.0", "@opentelemetry/api-metrics": "^0.33.0", - "@opentelemetry/host-metrics": "^0.30.1", + "@opentelemetry/host-metrics": "^0.31.0", "response-time": "^2.3.2" }, "devDependencies": { @@ -22,9 +22,8 @@ "@nestjs/platform-express": "^9.2.0", "@nestjs/platform-fastify": "^9.2.0", "@nestjs/testing": "^9.2.0", - "@opentelemetry/exporter-prometheus": "^0.33.0", - "@opentelemetry/sdk-metrics": "^0.33.0", - "@opentelemetry/sdk-node": "^0.33.0", + "@opentelemetry/exporter-prometheus": "^0.34.0", + "@opentelemetry/sdk-metrics": "^1.8.0", "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/jest": "^29.2.3", "@types/node": "^18.11.9", @@ -1720,9 +1719,9 @@ } }, "node_modules/@opentelemetry/api": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.2.0.tgz", - "integrity": "sha512-0nBr+VZNKm9tvNDZFstI3Pq1fCTEDK5OZTnVKNvBNAKgd0yIvmwsP4m61rEv7ZP+tOUjWJhROpxK5MsnlF911g==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.3.0.tgz", + "integrity": "sha512-YveTnGNsFFixTKJz09Oi4zYkiLT5af3WpZDu4aIUM7xX+2bHAkOJayFTVQd6zB8kkWPpbua4Ha6Ql00grdLlJQ==", "engines": { "node": ">=8.0.0" } @@ -1752,136 +1751,49 @@ } }, "node_modules/@opentelemetry/core": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.7.0.tgz", - "integrity": "sha512-AVqAi5uc8DrKJBimCTFUT4iFI+5eXpo4sYmGbQ0CypG0piOTHE2g9c5aSoTGYXu3CzOmJZf7pT6Xh+nwm5d6yQ==", - "dev": true, + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.8.0.tgz", + "integrity": "sha512-6SDjwBML4Am0AQmy7z1j6HGrWDgeK8awBRUvl1PGw6HayViMk4QpnUXvv4HTHisecgVBy43NE/cstWprm8tIfw==", "dependencies": { - "@opentelemetry/semantic-conventions": "1.7.0" + "@opentelemetry/semantic-conventions": "1.8.0" }, "engines": { "node": ">=14" }, "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.3.0" + "@opentelemetry/api": ">=1.0.0 <1.4.0" } }, "node_modules/@opentelemetry/exporter-prometheus": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-prometheus/-/exporter-prometheus-0.33.0.tgz", - "integrity": "sha512-J9H4iVDvgLfdmIQvRM7+sNJcaHRVdB8tear+WLzbXC52psMPczlhvytBRhL+23rGQQWM/J+EBrd07/qFsvnBBQ==", + "version": "0.34.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-prometheus/-/exporter-prometheus-0.34.0.tgz", + "integrity": "sha512-uPhtqR3S8M+mJZCTymKFf9PjCGpx1t7laPoPnR01SaClEkf5VCWk6CFfzJsyPJSwDy4cc3echzMfy7/hHdgXmg==", "dev": true, "dependencies": { - "@opentelemetry/api-metrics": "0.33.0", - "@opentelemetry/core": "1.7.0", - "@opentelemetry/sdk-metrics": "0.33.0" + "@opentelemetry/core": "1.8.0", + "@opentelemetry/resources": "1.8.0", + "@opentelemetry/sdk-metrics": "1.8.0" }, "engines": { "node": ">=14" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/host-metrics": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/host-metrics/-/host-metrics-0.30.1.tgz", - "integrity": "sha512-bbekNdziazNmrrUYJsnAnL5smRcOGbm0iyivBCvw4Ma4Bfs4zXi+CQAPaeHnB2Wv8o3cNDioEF9IJUNTWLb7Gw==", + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/host-metrics/-/host-metrics-0.31.0.tgz", + "integrity": "sha512-5NSplpuTD1fQmiwJ7/TnzsWP1pj4FRrVBVBGIZkDsLqy12Zx++atvlR40677zVkumP3ERaZnpqpNetegLrdmOg==", "dependencies": { - "@opentelemetry/api-metrics": "^0.32.0", - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/sdk-metrics": "^0.32.0", + "@opentelemetry/sdk-metrics": "^1.8.0", "systeminformation": "^5.0.0" }, "engines": { "node": ">=14" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/@opentelemetry/host-metrics/node_modules/@opentelemetry/api-metrics": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-metrics/-/api-metrics-0.32.0.tgz", - "integrity": "sha512-g1WLhpG8B6iuDyZJFRGsR+JKyZ94m5LEmY2f+duEJ9Xb4XRlLHrZvh6G34OH6GJ8iDHxfHb/sWjJ1ZpkI9yGMQ==", - "deprecated": "Please use @opentelemetry/api >= 1.3.0", - "dependencies": { - "@opentelemetry/api": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@opentelemetry/host-metrics/node_modules/@opentelemetry/core": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.6.0.tgz", - "integrity": "sha512-MsEhsyCTfYme6frK8/AqEWwbS9SB3Ta5bjgz4jPQJjL7ijUM3JiLVvqh/kHo1UlUjbUbLmGG7jA5Nw4d7SMcLQ==", - "dependencies": { - "@opentelemetry/semantic-conventions": "1.6.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.3.0" - } - }, - "node_modules/@opentelemetry/host-metrics/node_modules/@opentelemetry/resources": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.6.0.tgz", - "integrity": "sha512-07GlHuq72r2rnJugYVdGumviQvfrl8kEPidkZSVoseLVfIjV7nzxxt5/vqs9pK7JItWOrvjRdr/jTBVayFBr/w==", - "dependencies": { - "@opentelemetry/core": "1.6.0", - "@opentelemetry/semantic-conventions": "1.6.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.3.0" - } - }, - "node_modules/@opentelemetry/host-metrics/node_modules/@opentelemetry/sdk-metrics": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-0.32.0.tgz", - "integrity": "sha512-zC9RCOIsXRqOHWmWfcxArtDHbip2/jaIH1yu/OKau/shDZYFluAxY6zAEYIb4YEAzKKEF+fpaoRgpodDWNGVGA==", - "dependencies": { - "@opentelemetry/api-metrics": "0.32.0", - "@opentelemetry/core": "1.6.0", - "@opentelemetry/resources": "1.6.0", - "lodash.merge": "4.6.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/@opentelemetry/host-metrics/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.6.0.tgz", - "integrity": "sha512-aPfcBeLErM/PPiAuAbNFLN5sNbZLc3KZlar27uohllN8Zs6jJbHyJU1y7cMA6W/zuq+thkaG8mujiS+3iD/FWQ==", - "engines": { - "node": ">=14" - } - }, - "node_modules/@opentelemetry/instrumentation": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.33.0.tgz", - "integrity": "sha512-8joPjKJ6TznNt04JbnzZG+m1j/4wm1OIrX7DEw/V5lyZ9/2fahIqG72jeZ26VKOZnLOpVzUUnU/dweURqBzT3Q==", - "dev": true, - "dependencies": { - "@opentelemetry/api-metrics": "0.33.0", - "require-in-the-middle": "^5.0.3", - "semver": "^7.3.2", - "shimmer": "^1.2.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/propagator-b3": { @@ -1899,30 +1811,6 @@ "@opentelemetry/api": ">=1.0.0 <1.4.0" } }, - "node_modules/@opentelemetry/propagator-b3/node_modules/@opentelemetry/core": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.8.0.tgz", - "integrity": "sha512-6SDjwBML4Am0AQmy7z1j6HGrWDgeK8awBRUvl1PGw6HayViMk4QpnUXvv4HTHisecgVBy43NE/cstWprm8tIfw==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.8.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.4.0" - } - }, - "node_modules/@opentelemetry/propagator-b3/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.8.0.tgz", - "integrity": "sha512-TYh1MRcm4JnvpqtqOwT9WYaBYY4KERHdToxs/suDTLviGRsQkIjS5yYROTYTSJQUnYLOn/TuOh5GoMwfLSU+Ew==", - "dev": true, - "engines": { - "node": ">=14" - } - }, "node_modules/@opentelemetry/propagator-jaeger": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-jaeger/-/propagator-jaeger-1.8.0.tgz", @@ -1938,12 +1826,12 @@ "@opentelemetry/api": ">=1.0.0 <1.4.0" } }, - "node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core": { + "node_modules/@opentelemetry/resources": { "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.8.0.tgz", - "integrity": "sha512-6SDjwBML4Am0AQmy7z1j6HGrWDgeK8awBRUvl1PGw6HayViMk4QpnUXvv4HTHisecgVBy43NE/cstWprm8tIfw==", - "dev": true, + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.8.0.tgz", + "integrity": "sha512-KSyMH6Jvss/PFDy16z5qkCK0ERlpyqixb1xwb73wLMvVq+j7i89lobDjw3JkpCcd1Ws0J6jAI4fw28Zufj2ssg==", "dependencies": { + "@opentelemetry/core": "1.8.0", "@opentelemetry/semantic-conventions": "1.8.0" }, "engines": { @@ -1953,147 +1841,37 @@ "@opentelemetry/api": ">=1.0.0 <1.4.0" } }, - "node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.8.0.tgz", - "integrity": "sha512-TYh1MRcm4JnvpqtqOwT9WYaBYY4KERHdToxs/suDTLviGRsQkIjS5yYROTYTSJQUnYLOn/TuOh5GoMwfLSU+Ew==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/@opentelemetry/resources": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.7.0.tgz", - "integrity": "sha512-u1M0yZotkjyKx8dj+46Sg5thwtOTBmtRieNXqdCRiWUp6SfFiIP0bI+1XK3LhuXqXkBXA1awJZaTqKduNMStRg==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.7.0", - "@opentelemetry/semantic-conventions": "1.7.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.3.0" - } - }, "node_modules/@opentelemetry/sdk-metrics": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-0.33.0.tgz", - "integrity": "sha512-ZXPixOlTd/FHLwpkmm5nTpJE7bZOPfmbSz8hBVFCEHkXE1aKEKaM38UFnZ+2xzOY1tDsDwyxEiiBiDX8y3039A==", - "dev": true, + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.8.0.tgz", + "integrity": "sha512-+KYb+uj0vHhl8xzJO+oChS4oP1e+/2Wl3SXoHoIdcEjd1TQfDV+lxOm4oqxWq6wykXvI35/JHyejxSoT+qxGmg==", "dependencies": { - "@opentelemetry/api-metrics": "0.33.0", - "@opentelemetry/core": "1.7.0", - "@opentelemetry/resources": "1.7.0", + "@opentelemetry/core": "1.8.0", + "@opentelemetry/resources": "1.8.0", "lodash.merge": "4.6.2" }, "engines": { "node": ">=14" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/@opentelemetry/sdk-node": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-node/-/sdk-node-0.33.0.tgz", - "integrity": "sha512-wcXimvZOrFz+mRORoq+9OIusqoP8bnqbSF6U2XRUMQX986UoM6dAjwB5cslyRbrN4Feju+6tp70g6HTdl6BYMA==", - "dev": true, - "dependencies": { - "@opentelemetry/api-metrics": "0.33.0", - "@opentelemetry/core": "1.7.0", - "@opentelemetry/instrumentation": "0.33.0", - "@opentelemetry/resources": "1.7.0", - "@opentelemetry/sdk-metrics": "0.33.0", - "@opentelemetry/sdk-trace-base": "1.7.0", - "@opentelemetry/sdk-trace-node": "1.7.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.3.0" - } - }, - "node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/context-async-hooks": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.7.0.tgz", - "integrity": "sha512-g4bMzyVW5dVBeMkyadaf3NRFpmNrdD4Pp9OJsrP29HwIam/zVMNfIWQpT5IBzjtTSMhl/ED5YQYR+UOSjVq3sQ==", - "dev": true, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.3.0" - } - }, - "node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/propagator-b3": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-b3/-/propagator-b3-1.7.0.tgz", - "integrity": "sha512-8kKGS1KwArvkThdhubMZlomuREE9FaBcn9L4JrYHh2jly1FZpqOtFNO2byHymVRjH59d43Pa+eJuFpD0Fp7kSw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.7.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.3.0" - } - }, - "node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/propagator-jaeger": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-jaeger/-/propagator-jaeger-1.7.0.tgz", - "integrity": "sha512-V7i/L1bx+R/ve4z6dTdn2jtvFxGThRsXS2wNb/tWZVfV8gqnePQp+HfoLrqB/Yz2iRPUcMWrcjx6vV78umvJFA==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.7.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.3.0" - } - }, - "node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/sdk-trace-node": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-node/-/sdk-trace-node-1.7.0.tgz", - "integrity": "sha512-DCAAbi0Zbb1pIofQcKzoAVy9/6bz24asFYeLb4fW/8QYAaawDnxumA++5Huw/RcYdJs8q8AIRBykwjYWWCm/5A==", - "dev": true, - "dependencies": { - "@opentelemetry/context-async-hooks": "1.7.0", - "@opentelemetry/core": "1.7.0", - "@opentelemetry/propagator-b3": "1.7.0", - "@opentelemetry/propagator-jaeger": "1.7.0", - "@opentelemetry/sdk-trace-base": "1.7.0", - "semver": "^7.3.5" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.3.0" + "@opentelemetry/api": ">=1.3.0 <1.4.0" } }, "node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.7.0.tgz", - "integrity": "sha512-Iz84C+FVOskmauh9FNnj4+VrA+hG5o+tkMzXuoesvSfunVSioXib0syVFeNXwOm4+M5GdWCuW632LVjqEXStIg==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.8.0.tgz", + "integrity": "sha512-iH41m0UTddnCKJzZx3M85vlhKzRcmT48pUeBbnzsGrq4nIay1oWVHKM5nhB5r8qRDGvd/n7f/YLCXClxwM0tvA==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.7.0", - "@opentelemetry/resources": "1.7.0", - "@opentelemetry/semantic-conventions": "1.7.0" + "@opentelemetry/core": "1.8.0", + "@opentelemetry/resources": "1.8.0", + "@opentelemetry/semantic-conventions": "1.8.0" }, "engines": { "node": ">=14" }, "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.3.0" + "@opentelemetry/api": ">=1.0.0 <1.4.0" } }, "node_modules/@opentelemetry/sdk-trace-node": { @@ -2116,68 +1894,10 @@ "@opentelemetry/api": ">=1.0.0 <1.4.0" } }, - "node_modules/@opentelemetry/sdk-trace-node/node_modules/@opentelemetry/core": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.8.0.tgz", - "integrity": "sha512-6SDjwBML4Am0AQmy7z1j6HGrWDgeK8awBRUvl1PGw6HayViMk4QpnUXvv4HTHisecgVBy43NE/cstWprm8tIfw==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.8.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.4.0" - } - }, - "node_modules/@opentelemetry/sdk-trace-node/node_modules/@opentelemetry/resources": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.8.0.tgz", - "integrity": "sha512-KSyMH6Jvss/PFDy16z5qkCK0ERlpyqixb1xwb73wLMvVq+j7i89lobDjw3JkpCcd1Ws0J6jAI4fw28Zufj2ssg==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.8.0", - "@opentelemetry/semantic-conventions": "1.8.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.4.0" - } - }, - "node_modules/@opentelemetry/sdk-trace-node/node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.8.0.tgz", - "integrity": "sha512-iH41m0UTddnCKJzZx3M85vlhKzRcmT48pUeBbnzsGrq4nIay1oWVHKM5nhB5r8qRDGvd/n7f/YLCXClxwM0tvA==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.8.0", - "@opentelemetry/resources": "1.8.0", - "@opentelemetry/semantic-conventions": "1.8.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.4.0" - } - }, - "node_modules/@opentelemetry/sdk-trace-node/node_modules/@opentelemetry/semantic-conventions": { + "node_modules/@opentelemetry/semantic-conventions": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.8.0.tgz", "integrity": "sha512-TYh1MRcm4JnvpqtqOwT9WYaBYY4KERHdToxs/suDTLviGRsQkIjS5yYROTYTSJQUnYLOn/TuOh5GoMwfLSU+Ew==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/@opentelemetry/semantic-conventions": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.7.0.tgz", - "integrity": "sha512-FGBx/Qd09lMaqQcogCHyYrFEpTx4cAjeS+48lMIR12z7LdH+zofGDVQSubN59nL6IpubfKqTeIDu9rNO28iHVA==", - "dev": true, "engines": { "node": ">=14" } @@ -7104,12 +6824,6 @@ "obliterator": "^2.0.1" } }, - "node_modules/module-details-from-path": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz", - "integrity": "sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==", - "dev": true - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -8093,20 +7807,6 @@ "node": ">=0.10.0" } }, - "node_modules/require-in-the-middle": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-5.2.0.tgz", - "integrity": "sha512-efCx3b+0Z69/LGJmm9Yvi4cqEdxnoGnxYxGxBghkkTTFeXRtTCmmhO0AnAfHz59k957uTSuy8WaHqOs8wbYUWg==", - "dev": true, - "dependencies": { - "debug": "^4.1.1", - "module-details-from-path": "^1.0.3", - "resolve": "^1.22.1" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/resolve": { "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", @@ -8443,12 +8143,6 @@ "node": ">=8" } }, - "node_modules/shimmer": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", - "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==", - "dev": true - }, "node_modules/side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -10903,9 +10597,9 @@ } }, "@opentelemetry/api": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.2.0.tgz", - "integrity": "sha512-0nBr+VZNKm9tvNDZFstI3Pq1fCTEDK5OZTnVKNvBNAKgd0yIvmwsP4m61rEv7ZP+tOUjWJhROpxK5MsnlF911g==" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.3.0.tgz", + "integrity": "sha512-YveTnGNsFFixTKJz09Oi4zYkiLT5af3WpZDu4aIUM7xX+2bHAkOJayFTVQd6zB8kkWPpbua4Ha6Ql00grdLlJQ==" }, "@opentelemetry/api-metrics": { "version": "0.33.0", @@ -10923,89 +10617,31 @@ "requires": {} }, "@opentelemetry/core": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.7.0.tgz", - "integrity": "sha512-AVqAi5uc8DrKJBimCTFUT4iFI+5eXpo4sYmGbQ0CypG0piOTHE2g9c5aSoTGYXu3CzOmJZf7pT6Xh+nwm5d6yQ==", - "dev": true, + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.8.0.tgz", + "integrity": "sha512-6SDjwBML4Am0AQmy7z1j6HGrWDgeK8awBRUvl1PGw6HayViMk4QpnUXvv4HTHisecgVBy43NE/cstWprm8tIfw==", "requires": { - "@opentelemetry/semantic-conventions": "1.7.0" + "@opentelemetry/semantic-conventions": "1.8.0" } }, "@opentelemetry/exporter-prometheus": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-prometheus/-/exporter-prometheus-0.33.0.tgz", - "integrity": "sha512-J9H4iVDvgLfdmIQvRM7+sNJcaHRVdB8tear+WLzbXC52psMPczlhvytBRhL+23rGQQWM/J+EBrd07/qFsvnBBQ==", + "version": "0.34.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-prometheus/-/exporter-prometheus-0.34.0.tgz", + "integrity": "sha512-uPhtqR3S8M+mJZCTymKFf9PjCGpx1t7laPoPnR01SaClEkf5VCWk6CFfzJsyPJSwDy4cc3echzMfy7/hHdgXmg==", "dev": true, "requires": { - "@opentelemetry/api-metrics": "0.33.0", - "@opentelemetry/core": "1.7.0", - "@opentelemetry/sdk-metrics": "0.33.0" + "@opentelemetry/core": "1.8.0", + "@opentelemetry/resources": "1.8.0", + "@opentelemetry/sdk-metrics": "1.8.0" } }, "@opentelemetry/host-metrics": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/host-metrics/-/host-metrics-0.30.1.tgz", - "integrity": "sha512-bbekNdziazNmrrUYJsnAnL5smRcOGbm0iyivBCvw4Ma4Bfs4zXi+CQAPaeHnB2Wv8o3cNDioEF9IJUNTWLb7Gw==", + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/host-metrics/-/host-metrics-0.31.0.tgz", + "integrity": "sha512-5NSplpuTD1fQmiwJ7/TnzsWP1pj4FRrVBVBGIZkDsLqy12Zx++atvlR40677zVkumP3ERaZnpqpNetegLrdmOg==", "requires": { - "@opentelemetry/api-metrics": "^0.32.0", - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/sdk-metrics": "^0.32.0", + "@opentelemetry/sdk-metrics": "^1.8.0", "systeminformation": "^5.0.0" - }, - "dependencies": { - "@opentelemetry/api-metrics": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-metrics/-/api-metrics-0.32.0.tgz", - "integrity": "sha512-g1WLhpG8B6iuDyZJFRGsR+JKyZ94m5LEmY2f+duEJ9Xb4XRlLHrZvh6G34OH6GJ8iDHxfHb/sWjJ1ZpkI9yGMQ==", - "requires": { - "@opentelemetry/api": "^1.0.0" - } - }, - "@opentelemetry/core": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.6.0.tgz", - "integrity": "sha512-MsEhsyCTfYme6frK8/AqEWwbS9SB3Ta5bjgz4jPQJjL7ijUM3JiLVvqh/kHo1UlUjbUbLmGG7jA5Nw4d7SMcLQ==", - "requires": { - "@opentelemetry/semantic-conventions": "1.6.0" - } - }, - "@opentelemetry/resources": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.6.0.tgz", - "integrity": "sha512-07GlHuq72r2rnJugYVdGumviQvfrl8kEPidkZSVoseLVfIjV7nzxxt5/vqs9pK7JItWOrvjRdr/jTBVayFBr/w==", - "requires": { - "@opentelemetry/core": "1.6.0", - "@opentelemetry/semantic-conventions": "1.6.0" - } - }, - "@opentelemetry/sdk-metrics": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-0.32.0.tgz", - "integrity": "sha512-zC9RCOIsXRqOHWmWfcxArtDHbip2/jaIH1yu/OKau/shDZYFluAxY6zAEYIb4YEAzKKEF+fpaoRgpodDWNGVGA==", - "requires": { - "@opentelemetry/api-metrics": "0.32.0", - "@opentelemetry/core": "1.6.0", - "@opentelemetry/resources": "1.6.0", - "lodash.merge": "4.6.2" - } - }, - "@opentelemetry/semantic-conventions": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.6.0.tgz", - "integrity": "sha512-aPfcBeLErM/PPiAuAbNFLN5sNbZLc3KZlar27uohllN8Zs6jJbHyJU1y7cMA6W/zuq+thkaG8mujiS+3iD/FWQ==" - } - } - }, - "@opentelemetry/instrumentation": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.33.0.tgz", - "integrity": "sha512-8joPjKJ6TznNt04JbnzZG+m1j/4wm1OIrX7DEw/V5lyZ9/2fahIqG72jeZ26VKOZnLOpVzUUnU/dweURqBzT3Q==", - "dev": true, - "requires": { - "@opentelemetry/api-metrics": "0.33.0", - "require-in-the-middle": "^5.0.3", - "semver": "^7.3.2", - "shimmer": "^1.2.1" } }, "@opentelemetry/propagator-b3": { @@ -11015,23 +10651,6 @@ "dev": true, "requires": { "@opentelemetry/core": "1.8.0" - }, - "dependencies": { - "@opentelemetry/core": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.8.0.tgz", - "integrity": "sha512-6SDjwBML4Am0AQmy7z1j6HGrWDgeK8awBRUvl1PGw6HayViMk4QpnUXvv4HTHisecgVBy43NE/cstWprm8tIfw==", - "dev": true, - "requires": { - "@opentelemetry/semantic-conventions": "1.8.0" - } - }, - "@opentelemetry/semantic-conventions": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.8.0.tgz", - "integrity": "sha512-TYh1MRcm4JnvpqtqOwT9WYaBYY4KERHdToxs/suDTLviGRsQkIjS5yYROTYTSJQUnYLOn/TuOh5GoMwfLSU+Ew==", - "dev": true - } } }, "@opentelemetry/propagator-jaeger": { @@ -11041,112 +10660,36 @@ "dev": true, "requires": { "@opentelemetry/core": "1.8.0" - }, - "dependencies": { - "@opentelemetry/core": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.8.0.tgz", - "integrity": "sha512-6SDjwBML4Am0AQmy7z1j6HGrWDgeK8awBRUvl1PGw6HayViMk4QpnUXvv4HTHisecgVBy43NE/cstWprm8tIfw==", - "dev": true, - "requires": { - "@opentelemetry/semantic-conventions": "1.8.0" - } - }, - "@opentelemetry/semantic-conventions": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.8.0.tgz", - "integrity": "sha512-TYh1MRcm4JnvpqtqOwT9WYaBYY4KERHdToxs/suDTLviGRsQkIjS5yYROTYTSJQUnYLOn/TuOh5GoMwfLSU+Ew==", - "dev": true - } } }, "@opentelemetry/resources": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.7.0.tgz", - "integrity": "sha512-u1M0yZotkjyKx8dj+46Sg5thwtOTBmtRieNXqdCRiWUp6SfFiIP0bI+1XK3LhuXqXkBXA1awJZaTqKduNMStRg==", - "dev": true, + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.8.0.tgz", + "integrity": "sha512-KSyMH6Jvss/PFDy16z5qkCK0ERlpyqixb1xwb73wLMvVq+j7i89lobDjw3JkpCcd1Ws0J6jAI4fw28Zufj2ssg==", "requires": { - "@opentelemetry/core": "1.7.0", - "@opentelemetry/semantic-conventions": "1.7.0" + "@opentelemetry/core": "1.8.0", + "@opentelemetry/semantic-conventions": "1.8.0" } }, "@opentelemetry/sdk-metrics": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-0.33.0.tgz", - "integrity": "sha512-ZXPixOlTd/FHLwpkmm5nTpJE7bZOPfmbSz8hBVFCEHkXE1aKEKaM38UFnZ+2xzOY1tDsDwyxEiiBiDX8y3039A==", - "dev": true, + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.8.0.tgz", + "integrity": "sha512-+KYb+uj0vHhl8xzJO+oChS4oP1e+/2Wl3SXoHoIdcEjd1TQfDV+lxOm4oqxWq6wykXvI35/JHyejxSoT+qxGmg==", "requires": { - "@opentelemetry/api-metrics": "0.33.0", - "@opentelemetry/core": "1.7.0", - "@opentelemetry/resources": "1.7.0", + "@opentelemetry/core": "1.8.0", + "@opentelemetry/resources": "1.8.0", "lodash.merge": "4.6.2" } }, - "@opentelemetry/sdk-node": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-node/-/sdk-node-0.33.0.tgz", - "integrity": "sha512-wcXimvZOrFz+mRORoq+9OIusqoP8bnqbSF6U2XRUMQX986UoM6dAjwB5cslyRbrN4Feju+6tp70g6HTdl6BYMA==", - "dev": true, - "requires": { - "@opentelemetry/api-metrics": "0.33.0", - "@opentelemetry/core": "1.7.0", - "@opentelemetry/instrumentation": "0.33.0", - "@opentelemetry/resources": "1.7.0", - "@opentelemetry/sdk-metrics": "0.33.0", - "@opentelemetry/sdk-trace-base": "1.7.0", - "@opentelemetry/sdk-trace-node": "1.7.0" - }, - "dependencies": { - "@opentelemetry/context-async-hooks": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.7.0.tgz", - "integrity": "sha512-g4bMzyVW5dVBeMkyadaf3NRFpmNrdD4Pp9OJsrP29HwIam/zVMNfIWQpT5IBzjtTSMhl/ED5YQYR+UOSjVq3sQ==", - "dev": true, - "requires": {} - }, - "@opentelemetry/propagator-b3": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-b3/-/propagator-b3-1.7.0.tgz", - "integrity": "sha512-8kKGS1KwArvkThdhubMZlomuREE9FaBcn9L4JrYHh2jly1FZpqOtFNO2byHymVRjH59d43Pa+eJuFpD0Fp7kSw==", - "dev": true, - "requires": { - "@opentelemetry/core": "1.7.0" - } - }, - "@opentelemetry/propagator-jaeger": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-jaeger/-/propagator-jaeger-1.7.0.tgz", - "integrity": "sha512-V7i/L1bx+R/ve4z6dTdn2jtvFxGThRsXS2wNb/tWZVfV8gqnePQp+HfoLrqB/Yz2iRPUcMWrcjx6vV78umvJFA==", - "dev": true, - "requires": { - "@opentelemetry/core": "1.7.0" - } - }, - "@opentelemetry/sdk-trace-node": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-node/-/sdk-trace-node-1.7.0.tgz", - "integrity": "sha512-DCAAbi0Zbb1pIofQcKzoAVy9/6bz24asFYeLb4fW/8QYAaawDnxumA++5Huw/RcYdJs8q8AIRBykwjYWWCm/5A==", - "dev": true, - "requires": { - "@opentelemetry/context-async-hooks": "1.7.0", - "@opentelemetry/core": "1.7.0", - "@opentelemetry/propagator-b3": "1.7.0", - "@opentelemetry/propagator-jaeger": "1.7.0", - "@opentelemetry/sdk-trace-base": "1.7.0", - "semver": "^7.3.5" - } - } - } - }, "@opentelemetry/sdk-trace-base": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.7.0.tgz", - "integrity": "sha512-Iz84C+FVOskmauh9FNnj4+VrA+hG5o+tkMzXuoesvSfunVSioXib0syVFeNXwOm4+M5GdWCuW632LVjqEXStIg==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.8.0.tgz", + "integrity": "sha512-iH41m0UTddnCKJzZx3M85vlhKzRcmT48pUeBbnzsGrq4nIay1oWVHKM5nhB5r8qRDGvd/n7f/YLCXClxwM0tvA==", "dev": true, "requires": { - "@opentelemetry/core": "1.7.0", - "@opentelemetry/resources": "1.7.0", - "@opentelemetry/semantic-conventions": "1.7.0" + "@opentelemetry/core": "1.8.0", + "@opentelemetry/resources": "1.8.0", + "@opentelemetry/semantic-conventions": "1.8.0" } }, "@opentelemetry/sdk-trace-node": { @@ -11161,51 +10704,12 @@ "@opentelemetry/propagator-jaeger": "1.8.0", "@opentelemetry/sdk-trace-base": "1.8.0", "semver": "^7.3.5" - }, - "dependencies": { - "@opentelemetry/core": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.8.0.tgz", - "integrity": "sha512-6SDjwBML4Am0AQmy7z1j6HGrWDgeK8awBRUvl1PGw6HayViMk4QpnUXvv4HTHisecgVBy43NE/cstWprm8tIfw==", - "dev": true, - "requires": { - "@opentelemetry/semantic-conventions": "1.8.0" - } - }, - "@opentelemetry/resources": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.8.0.tgz", - "integrity": "sha512-KSyMH6Jvss/PFDy16z5qkCK0ERlpyqixb1xwb73wLMvVq+j7i89lobDjw3JkpCcd1Ws0J6jAI4fw28Zufj2ssg==", - "dev": true, - "requires": { - "@opentelemetry/core": "1.8.0", - "@opentelemetry/semantic-conventions": "1.8.0" - } - }, - "@opentelemetry/sdk-trace-base": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.8.0.tgz", - "integrity": "sha512-iH41m0UTddnCKJzZx3M85vlhKzRcmT48pUeBbnzsGrq4nIay1oWVHKM5nhB5r8qRDGvd/n7f/YLCXClxwM0tvA==", - "dev": true, - "requires": { - "@opentelemetry/core": "1.8.0", - "@opentelemetry/resources": "1.8.0", - "@opentelemetry/semantic-conventions": "1.8.0" - } - }, - "@opentelemetry/semantic-conventions": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.8.0.tgz", - "integrity": "sha512-TYh1MRcm4JnvpqtqOwT9WYaBYY4KERHdToxs/suDTLviGRsQkIjS5yYROTYTSJQUnYLOn/TuOh5GoMwfLSU+Ew==", - "dev": true - } } }, "@opentelemetry/semantic-conventions": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.7.0.tgz", - "integrity": "sha512-FGBx/Qd09lMaqQcogCHyYrFEpTx4cAjeS+48lMIR12z7LdH+zofGDVQSubN59nL6IpubfKqTeIDu9rNO28iHVA==", - "dev": true + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.8.0.tgz", + "integrity": "sha512-TYh1MRcm4JnvpqtqOwT9WYaBYY4KERHdToxs/suDTLviGRsQkIjS5yYROTYTSJQUnYLOn/TuOh5GoMwfLSU+Ew==" }, "@sinclair/typebox": { "version": "0.24.51", @@ -14902,12 +14406,6 @@ "obliterator": "^2.0.1" } }, - "module-details-from-path": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz", - "integrity": "sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==", - "dev": true - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -15634,17 +15132,6 @@ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true }, - "require-in-the-middle": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-5.2.0.tgz", - "integrity": "sha512-efCx3b+0Z69/LGJmm9Yvi4cqEdxnoGnxYxGxBghkkTTFeXRtTCmmhO0AnAfHz59k957uTSuy8WaHqOs8wbYUWg==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "module-details-from-path": "^1.0.3", - "resolve": "^1.22.1" - } - }, "resolve": { "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", @@ -15895,12 +15382,6 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, - "shimmer": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", - "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==", - "dev": true - }, "side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", diff --git a/package.json b/package.json index 5a49df2..9deb355 100644 --- a/package.json +++ b/package.json @@ -36,9 +36,9 @@ }, "homepage": "https://github.com/pragmaticivan/nestjs-otel#readme", "dependencies": { - "@opentelemetry/api": "^1.2.0", + "@opentelemetry/api": "^1.3.0", "@opentelemetry/api-metrics": "^0.33.0", - "@opentelemetry/host-metrics": "^0.30.1", + "@opentelemetry/host-metrics": "^0.31.0", "response-time": "^2.3.2" }, "devDependencies": { @@ -49,9 +49,8 @@ "@nestjs/platform-express": "^9.2.0", "@nestjs/platform-fastify": "^9.2.0", "@nestjs/testing": "^9.2.0", - "@opentelemetry/exporter-prometheus": "^0.33.0", - "@opentelemetry/sdk-metrics": "^0.33.0", - "@opentelemetry/sdk-node": "^0.33.0", + "@opentelemetry/exporter-prometheus": "^0.34.0", + "@opentelemetry/sdk-metrics": "^1.8.0", "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/jest": "^29.2.3", "@types/node": "^18.11.9", diff --git a/src/interfaces/opentelemetry-options.interface.ts b/src/interfaces/opentelemetry-options.interface.ts index 5414566..d2701d7 100644 --- a/src/interfaces/opentelemetry-options.interface.ts +++ b/src/interfaces/opentelemetry-options.interface.ts @@ -1,5 +1,5 @@ import { ModuleMetadata, Type, Abstract } from '@nestjs/common'; -import { MetricAttributes } from '@opentelemetry/api-metrics'; +import { MetricAttributes } from '@opentelemetry/api'; import { RouteInfo } from '@nestjs/common/interfaces'; export type OpenTelemetryModuleOptions = { diff --git a/src/metrics/decorators/common.ts b/src/metrics/decorators/common.ts index e7c3e30..2aa8f72 100644 --- a/src/metrics/decorators/common.ts +++ b/src/metrics/decorators/common.ts @@ -1,4 +1,4 @@ -import { Counter, MetricOptions } from '@opentelemetry/api-metrics'; +import { Counter, MetricOptions } from '@opentelemetry/api'; import { copyMetadataFromFunctionToFunction } from '../../opentelemetry.utils'; import { getOrCreateCounter } from '../metric-data'; diff --git a/src/metrics/decorators/counter.ts b/src/metrics/decorators/counter.ts index 9f22326..885fc79 100644 --- a/src/metrics/decorators/counter.ts +++ b/src/metrics/decorators/counter.ts @@ -1,5 +1,5 @@ import { createParamDecorator } from '@nestjs/common'; -import { MetricOptions } from '@opentelemetry/api-metrics'; +import { MetricOptions } from '@opentelemetry/api'; import { getOrCreateCounter, MetricType } from '../metric-data'; export const OtelCounter = createParamDecorator((name: string, options?: MetricOptions) => { diff --git a/src/metrics/decorators/histogram.ts b/src/metrics/decorators/histogram.ts index 6b0140d..62785d1 100644 --- a/src/metrics/decorators/histogram.ts +++ b/src/metrics/decorators/histogram.ts @@ -1,5 +1,5 @@ import { createParamDecorator } from '@nestjs/common'; -import { MetricOptions } from '@opentelemetry/api-metrics'; +import { MetricOptions } from '@opentelemetry/api'; import { getOrCreateHistogram } from '../metric-data'; export const OtelHistogram = createParamDecorator((name: string, options?: MetricOptions) => { diff --git a/src/metrics/decorators/observable.ts b/src/metrics/decorators/observable.ts index 21d3153..90c7253 100644 --- a/src/metrics/decorators/observable.ts +++ b/src/metrics/decorators/observable.ts @@ -1,5 +1,5 @@ import { createParamDecorator } from '@nestjs/common'; -import { MetricOptions } from '@opentelemetry/api-metrics'; +import { MetricOptions } from '@opentelemetry/api'; import { getOrCreateObservableCounter, getOrCreateObservableGauge, getOrCreateObservableUpDownCounter } from '../metric-data'; export const OtelObservableGauge = createParamDecorator((name: string, options?: MetricOptions) => { diff --git a/src/metrics/metric-data.ts b/src/metrics/metric-data.ts index 48cc89a..0ee29ed 100644 --- a/src/metrics/metric-data.ts +++ b/src/metrics/metric-data.ts @@ -1,7 +1,8 @@ import { - Counter, MetricOptions, metrics, UpDownCounter, - Histogram, ObservableGauge, ObservableCounter, ObservableUpDownCounter, ObservableResult, -} from '@opentelemetry/api-metrics'; + Counter, MetricOptions, UpDownCounter, + Histogram, ObservableGauge, ObservableCounter, ObservableUpDownCounter, + metrics, +} from '@opentelemetry/api'; import { OTEL_METER_NAME } from '../opentelemetry.constants'; export type GenericMetric = diff --git a/src/metrics/metric.service.ts b/src/metrics/metric.service.ts index 7835f9c..6528722 100644 --- a/src/metrics/metric.service.ts +++ b/src/metrics/metric.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; import { - MetricOptions, ObservableResult, -} from '@opentelemetry/api-metrics'; + MetricOptions, +} from '@opentelemetry/api'; import { getOrCreateCounter, getOrCreateHistogram, getOrCreateObservableCounter, getOrCreateObservableGauge, diff --git a/src/middleware/api-metrics.middleware.ts b/src/middleware/api-metrics.middleware.ts index ac4d494..24c3825 100644 --- a/src/middleware/api-metrics.middleware.ts +++ b/src/middleware/api-metrics.middleware.ts @@ -3,7 +3,7 @@ import * as responseTime from 'response-time'; import * as urlParser from 'url'; import { Counter, MetricAttributes, Histogram, UpDownCounter, -} from '@opentelemetry/api-metrics'; +} from '@opentelemetry/api'; import { OpenTelemetryModuleOptions } from '../interfaces'; import { MetricService } from '../metrics/metric.service'; import { OPENTELEMETRY_MODULE_OPTIONS } from '../opentelemetry.constants'; diff --git a/src/opentelemetry-core.module.ts b/src/opentelemetry-core.module.ts index 0f63c60..d59b3d5 100644 --- a/src/opentelemetry-core.module.ts +++ b/src/opentelemetry-core.module.ts @@ -4,7 +4,7 @@ import { Provider, Type, } from '@nestjs/common'; import { HostMetrics } from '@opentelemetry/host-metrics'; -import { metrics } from '@opentelemetry/api-metrics'; +import { metrics } from '@opentelemetry/api'; import { OpenTelemetryModuleAsyncOptions, OpenTelemetryModuleOptions, OpenTelemetryOptionsFactory } from './interfaces'; import { MetricService } from './metrics/metric.service'; import { ApiMetricsMiddleware } from './middleware'; diff --git a/src/tracing/decorators/span.spec.ts b/src/tracing/decorators/span.spec.ts index ca49c82..17473ce 100644 --- a/src/tracing/decorators/span.spec.ts +++ b/src/tracing/decorators/span.spec.ts @@ -1,7 +1,6 @@ import 'reflect-metadata'; import { SpanKind, SpanStatusCode } from '@opentelemetry/api'; -import { tracing } from '@opentelemetry/sdk-node'; -import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node'; +import { InMemorySpanExporter, NodeTracerProvider, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-node'; import { SetMetadata } from '@nestjs/common'; import { Span } from './span'; @@ -31,14 +30,14 @@ class TestSpan { describe('Span', () => { let instance: TestSpan; - let traceExporter: tracing.InMemorySpanExporter; - let spanProcessor: tracing.SimpleSpanProcessor; + let traceExporter: InMemorySpanExporter; + let spanProcessor: SimpleSpanProcessor; let provider: NodeTracerProvider; beforeAll(async () => { instance = new TestSpan(); - traceExporter = new tracing.InMemorySpanExporter(); - spanProcessor = new tracing.SimpleSpanProcessor(traceExporter); + traceExporter = new InMemorySpanExporter(); + spanProcessor = new SimpleSpanProcessor(traceExporter); provider = new NodeTracerProvider(); // TODO: figure out why that's failing with new version diff --git a/tests/e2e/metrics/decorators/common.spec.ts b/tests/e2e/metrics/decorators/common.spec.ts index 74389e6..1ba2637 100644 --- a/tests/e2e/metrics/decorators/common.spec.ts +++ b/tests/e2e/metrics/decorators/common.spec.ts @@ -1,9 +1,8 @@ import { INestApplication } from '@nestjs/common'; import { Test } from '@nestjs/testing'; -import { metrics } from '@opentelemetry/api-metrics'; +import { metrics } from '@opentelemetry/api'; +import { MeterProvider } from '@opentelemetry/sdk-metrics'; import { PrometheusExporter } from '@opentelemetry/exporter-prometheus'; -import { PeriodicExportingMetricReader } from '@opentelemetry/sdk-metrics'; -import { NodeSDK } from '@opentelemetry/sdk-node'; import * as request from 'supertest'; import { OpenTelemetryModule } from '../../../../src'; import { meterData } from '../../../../src/metrics/metric-data'; @@ -12,19 +11,27 @@ import { AppController } from '../../../fixture-app/app.controller'; describe('Common Decorators', () => { let app: INestApplication; let exporter: PrometheusExporter; - let otelSDK: NodeSDK; + let meterProvider: MeterProvider; - beforeEach(async () => { - exporter = new PrometheusExporter({ - preventServerStart: true, - }); - - otelSDK = new NodeSDK({ - metricReader: exporter, + beforeEach(done => { + exporter = new PrometheusExporter({}, () => { + meterProvider = new MeterProvider(); + meterProvider.addMetricReader(exporter); + metrics.setGlobalMeterProvider(meterProvider); + done(); }); + }); - await otelSDK.start(); - await exporter.startServer(); + afterEach(async () => { + metrics.disable(); + meterData.clear(); + if (exporter) { + await exporter.stopServer(); + await exporter.shutdown(); + } + if (app) { + await app.close(); + } }); describe('Instance counter & Method counter', () => { @@ -46,31 +53,15 @@ describe('Common Decorators', () => { const agent = request(app.getHttpServer()); await agent.get('/example/4?foo=bar'); - // Workaround for delay of metrics going to prometheus - await new Promise(resolve => setTimeout(resolve, 200)); - // TODO: OpenTelemetry exporter does not expose server in a public function. // @ts-ignore // eslint-disable-next-line no-underscore-dangle const { text } = await request(exporter._server) .get('/metrics') .expect(200); + expect(/app_AppController_instances_total 1/.test(text)).toBeTruthy(); expect(/app_AppController_example_calls_total 1/.test(text)).toBeTruthy(); }); }); - - afterEach(async () => { - metrics.disable(); - meterData.clear(); - if (exporter) { - await exporter.stopServer(); - } - if (otelSDK) { - await otelSDK.shutdown(); - } - if (app) { - await app.close(); - } - }); }); diff --git a/tests/e2e/metrics/metric.service.spec.ts b/tests/e2e/metrics/metric.service.spec.ts index fe2a560..a318845 100644 --- a/tests/e2e/metrics/metric.service.spec.ts +++ b/tests/e2e/metrics/metric.service.spec.ts @@ -1,8 +1,8 @@ import { Test } from '@nestjs/testing'; import { INestApplication } from '@nestjs/common'; import { PrometheusExporter } from '@opentelemetry/exporter-prometheus'; -import { NodeSDK } from '@opentelemetry/sdk-node'; -import { metrics } from '@opentelemetry/api-metrics'; +import { metrics } from '@opentelemetry/api'; +import { MeterProvider } from '@opentelemetry/sdk-metrics'; import { OpenTelemetryModule } from '../../../src/opentelemetry.module'; import { meterData } from '../../../src/metrics/metric-data'; import { MetricService } from '../../../src/metrics/metric.service'; @@ -11,19 +11,27 @@ describe('MetricService', () => { let metricService: MetricService; let app: INestApplication; let exporter: PrometheusExporter; - let otelSDK: NodeSDK; - - beforeEach(async () => { - exporter = new PrometheusExporter({ - preventServerStart: true, - }); - - otelSDK = new NodeSDK({ - metricReader: exporter, + let meterProvider: MeterProvider; + + beforeEach(done => { + exporter = new PrometheusExporter({}, () => { + meterProvider = new MeterProvider(); + meterProvider.addMetricReader(exporter); + metrics.setGlobalMeterProvider(meterProvider); + done(); }); + }); - await otelSDK.start(); + afterEach(async () => { + metrics.disable(); meterData.clear(); + if (exporter) { + await exporter.stopServer(); + await exporter.shutdown(); + } + if (app) { + await app.close(); + } }); describe('instance', () => { @@ -182,8 +190,7 @@ describe('MetricService', () => { // Starts empty expect(meterData.size).toBe(0); - const counter = metricService.getHistogram('test1'); - // counter.clear(); + metricService.getHistogram('test1'); // Has new key record const data = meterData; @@ -206,8 +213,7 @@ describe('MetricService', () => { metricService = moduleRef.get(MetricService); - const counter = metricService.getHistogram('test1', { description: 'test1 description' }); - // counter.clear(); + metricService.getHistogram('test1', { description: 'test1 description' }); const existingCounter = metricService.getHistogram('test1'); expect(meterData.has('test1')).toBeTruthy(); @@ -218,14 +224,4 @@ describe('MetricService', () => { expect(existingCounter._descriptor.description).toBe('test1 description'); }); }); - - afterEach(async () => { - metrics.disable(); - if (otelSDK) { - await otelSDK.shutdown(); - } - if (app) { - await app.close(); - } - }); }); diff --git a/tests/e2e/middleware/api-metrics.middleware.spec.ts b/tests/e2e/middleware/api-metrics.middleware.spec.ts index a518794..e8cf42b 100644 --- a/tests/e2e/middleware/api-metrics.middleware.spec.ts +++ b/tests/e2e/middleware/api-metrics.middleware.spec.ts @@ -2,7 +2,7 @@ import { INestApplication } from '@nestjs/common'; import { Test } from '@nestjs/testing'; import * as request from 'supertest'; import { PrometheusExporter } from '@opentelemetry/exporter-prometheus'; -import { metrics } from '@opentelemetry/api-metrics'; +import { metrics } from '@opentelemetry/api'; import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify'; import { MeterProvider } from '@opentelemetry/sdk-metrics'; import { MetricService, OpenTelemetryModule } from '../../../src';