From 515a495336052234ee5ffc6da4acc1d556046d2c Mon Sep 17 00:00:00 2001 From: Gerhard Stoebich <18708370+Flarna@users.noreply.github.com> Date: Fri, 18 Dec 2020 00:40:19 +0100 Subject: [PATCH 1/2] chore: update to OTel v0.14.0 Update all dependencies to 0.14.0 and adapt code to changed APIs. --- .../package.json | 10 +++++----- examples/dns/package.json | 10 +++++----- examples/express/package.json | 12 ++++++------ examples/graphql/package.json | 12 ++++++------ examples/grpc-census-prop/package.json | 10 +++++----- examples/hapi/package.json | 12 ++++++------ examples/host-metrics/package.json | 10 +++++----- examples/ioredis/package.json | 8 ++++---- examples/koa/package.json | 12 ++++++------ examples/mysql/package.json | 12 ++++++------ examples/postgres/package.json | 12 ++++++------ examples/react-load/preact/package.json | 8 ++++---- examples/react-load/react/package.json | 10 +++++----- examples/redis/package.json | 12 ++++++------ .../plugins-node-core-and-contrib/package.json | 2 +- packages/opentelemetry-host-metrics/package.json | 8 ++++---- packages/opentelemetry-host-metrics/src/metric.ts | 1 - .../opentelemetry-host-metrics/test/metric.test.ts | 14 +++++++------- packages/opentelemetry-test-utils/package.json | 6 +++--- .../package.json | 12 ++++++------ .../package.json | 6 +++--- .../opentelemetry-koa-instrumentation/package.json | 12 ++++++------ plugins/node/opentelemetry-plugin-dns/package.json | 8 ++++---- plugins/node/opentelemetry-plugin-dns/src/types.ts | 2 +- .../node/opentelemetry-plugin-express/package.json | 10 +++++----- .../node/opentelemetry-plugin-express/src/types.ts | 3 ++- .../node/opentelemetry-plugin-ioredis/package.json | 12 ++++++------ .../node/opentelemetry-plugin-ioredis/src/types.ts | 2 +- .../node/opentelemetry-plugin-mongodb/package.json | 12 ++++++------ .../test/mongodb.test.ts | 4 ++-- .../node/opentelemetry-plugin-mysql/package.json | 12 ++++++------ .../node/opentelemetry-plugin-pg-pool/package.json | 8 ++++---- plugins/node/opentelemetry-plugin-pg/package.json | 10 +++++----- plugins/node/opentelemetry-plugin-pg/src/utils.ts | 9 ++------- .../opentelemetry-plugin-pg/test/utils.test.ts | 3 ++- .../node/opentelemetry-plugin-redis/package.json | 12 ++++++------ .../package.json | 10 +++++----- .../src/documentLoad.ts | 5 +++-- .../test/documentLoad.test.ts | 9 ++------- .../opentelemetry-plugin-react-load/package.json | 14 +++++++------- .../package.json | 14 +++++++------- .../package.json | 4 ++-- .../opentelemetry-propagator-jaeger/package.json | 4 ++-- 43 files changed, 185 insertions(+), 193 deletions(-) diff --git a/detectors/node/opentelemetry-resource-detector-github/package.json b/detectors/node/opentelemetry-resource-detector-github/package.json index 1243086f9d..364dc4c768 100644 --- a/detectors/node/opentelemetry-resource-detector-github/package.json +++ b/detectors/node/opentelemetry-resource-detector-github/package.json @@ -43,8 +43,8 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/core": "^0.13.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/core": "^0.14.0", + "@opentelemetry/tracing": "^0.14.0", "@types/mocha": "8.0.1", "@types/node": "14.0.27", "@types/sinon": "9.0.4", @@ -60,8 +60,8 @@ "typescript": "3.9.7" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/core": "^0.13.0", - "@opentelemetry/resources": "^0.13.0" + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/core": "^0.14.0", + "@opentelemetry/resources": "^0.14.0" } } diff --git a/examples/dns/package.json b/examples/dns/package.json index f38ddb696b..8b2cbd0dab 100644 --- a/examples/dns/package.json +++ b/examples/dns/package.json @@ -26,12 +26,12 @@ "url": "https://github.com/open-telemetry/opentelemetry-js/issues" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/exporter-jaeger": "^0.13.0", - "@opentelemetry/exporter-zipkin": "^0.13.0", - "@opentelemetry/node": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/exporter-jaeger": "^0.14.0", + "@opentelemetry/exporter-zipkin": "^0.14.0", + "@opentelemetry/node": "^0.14.0", "@opentelemetry/plugin-dns": "^0.11.0", - "@opentelemetry/tracing": "^0.13.0" + "@opentelemetry/tracing": "^0.14.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js#readme", "devDependencies": { diff --git a/examples/express/package.json b/examples/express/package.json index 792abcd6a2..3f7269a65e 100644 --- a/examples/express/package.json +++ b/examples/express/package.json @@ -28,13 +28,13 @@ "url": "https://github.com/open-telemetry/opentelemetry-js/issues" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/exporter-jaeger": "^0.13.0", - "@opentelemetry/exporter-zipkin": "^0.13.0", - "@opentelemetry/node": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/exporter-jaeger": "^0.14.0", + "@opentelemetry/exporter-zipkin": "^0.14.0", + "@opentelemetry/node": "^0.14.0", "@opentelemetry/plugin-express": "^0.11.0", - "@opentelemetry/plugin-http": "^0.13.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/plugin-http": "^0.14.0", + "@opentelemetry/tracing": "^0.14.0", "axios": "^0.19.0", "express": "^4.17.1" }, diff --git a/examples/graphql/package.json b/examples/graphql/package.json index 86f9520356..a7ef503b50 100644 --- a/examples/graphql/package.json +++ b/examples/graphql/package.json @@ -31,14 +31,14 @@ "url": "https://github.com/open-telemetry/opentelemetry-js/issues" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/exporter-collector": "^0.13.0", - "@opentelemetry/node": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/exporter-collector": "^0.14.0", + "@opentelemetry/node": "^0.14.0", "@opentelemetry/plugin-express": "^0.11.0", "@opentelemetry/instrumentation-graphql": "^0.11.0", - "@opentelemetry/plugin-http": "^0.13.0", - "@opentelemetry/plugin-https": "^0.13.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/plugin-http": "^0.14.0", + "@opentelemetry/plugin-https": "^0.14.0", + "@opentelemetry/tracing": "^0.14.0", "apollo-server": "^2.18.1", "express": "^4.17.1", "express-graphql": "^0.11.0", diff --git a/examples/grpc-census-prop/package.json b/examples/grpc-census-prop/package.json index 9b91da33c2..ec9ed995b4 100644 --- a/examples/grpc-census-prop/package.json +++ b/examples/grpc-census-prop/package.json @@ -34,12 +34,12 @@ "@opencensus/instrumentation-grpc": "0.0.21", "@opencensus/nodejs": "0.0.21", "@opencensus/propagation-binaryformat": "0.0.21", - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/core": "^0.13.0", - "@opentelemetry/node": "^0.13.0", - "@opentelemetry/plugin-grpc": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/core": "^0.14.0", + "@opentelemetry/node": "^0.14.0", + "@opentelemetry/plugin-grpc": "^0.14.0", "@opentelemetry/propagator-grpc-census-binary": "^0.11.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/tracing": "^0.14.0", "grpc": "^1.24.2", "node-pre-gyp": "0.12.0" }, diff --git a/examples/hapi/package.json b/examples/hapi/package.json index 875a3c0126..4bd9d232e5 100644 --- a/examples/hapi/package.json +++ b/examples/hapi/package.json @@ -32,13 +32,13 @@ }, "dependencies": { "@hapi/hapi": "^19.2.0", - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/exporter-jaeger": "^0.13.0", - "@opentelemetry/exporter-zipkin": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/exporter-jaeger": "^0.14.0", + "@opentelemetry/exporter-zipkin": "^0.14.0", "@opentelemetry/hapi-instrumentation": "^0.11.0", - "@opentelemetry/node": "^0.13.0", - "@opentelemetry/plugin-http": "^0.13.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/node": "^0.14.0", + "@opentelemetry/plugin-http": "^0.14.0", + "@opentelemetry/tracing": "^0.14.0", "axios": "^0.19.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib#readme", diff --git a/examples/host-metrics/package.json b/examples/host-metrics/package.json index 79fb522545..e758ca382b 100644 --- a/examples/host-metrics/package.json +++ b/examples/host-metrics/package.json @@ -26,12 +26,12 @@ "url": "https://github.com/open-telemetry/opentelemetry-js/issues" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/core": "^0.13.0", - "@opentelemetry/exporter-collector": "^0.13.0", - "@opentelemetry/exporter-prometheus": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/core": "^0.14.0", + "@opentelemetry/exporter-collector": "^0.14.0", + "@opentelemetry/exporter-prometheus": "^0.14.0", "@opentelemetry/host-metrics": "^0.11.0", - "@opentelemetry/metrics": "^0.13.0" + "@opentelemetry/metrics": "^0.14.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js#readme" } diff --git a/examples/ioredis/package.json b/examples/ioredis/package.json index 9a56642c50..4ad398dc0c 100644 --- a/examples/ioredis/package.json +++ b/examples/ioredis/package.json @@ -28,11 +28,11 @@ "url": "https://github.com/open-telemetry/opentelemetry-js/issues" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/exporter-jaeger": "^0.13.0", - "@opentelemetry/node": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/exporter-jaeger": "^0.14.0", + "@opentelemetry/node": "^0.14.0", "@opentelemetry/plugin-ioredis": "^0.11.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/tracing": "^0.14.0", "ioredis": "^4.14.1" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js#readme" diff --git a/examples/koa/package.json b/examples/koa/package.json index dd98e463aa..f47323ced9 100644 --- a/examples/koa/package.json +++ b/examples/koa/package.json @@ -32,13 +32,13 @@ }, "dependencies": { "@koa/router": "^9.3.1", - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/exporter-jaeger": "^0.13.0", - "@opentelemetry/exporter-zipkin": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/exporter-jaeger": "^0.14.0", + "@opentelemetry/exporter-zipkin": "^0.14.0", "@opentelemetry/koa-instrumentation": "^0.11.0", - "@opentelemetry/node": "^0.13.0", - "@opentelemetry/plugin-http": "^0.13.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/node": "^0.14.0", + "@opentelemetry/plugin-http": "^0.14.0", + "@opentelemetry/tracing": "^0.14.0", "axios": "^0.19.0", "koa": "^2.13.0" }, diff --git a/examples/mysql/package.json b/examples/mysql/package.json index 0dcda0edb8..7e0464d755 100644 --- a/examples/mysql/package.json +++ b/examples/mysql/package.json @@ -28,13 +28,13 @@ "url": "https://github.com/open-telemetry/opentelemetry-js/issues" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/exporter-jaeger": "^0.13.0", - "@opentelemetry/exporter-zipkin": "^0.13.0", - "@opentelemetry/node": "^0.13.0", - "@opentelemetry/plugin-http": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/exporter-jaeger": "^0.14.0", + "@opentelemetry/exporter-zipkin": "^0.14.0", + "@opentelemetry/node": "^0.14.0", + "@opentelemetry/plugin-http": "^0.14.0", "@opentelemetry/plugin-mysql": "^0.11.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/tracing": "^0.14.0", "mysql": "*" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js#readme", diff --git a/examples/postgres/package.json b/examples/postgres/package.json index 2b2a0c782c..9e23c57e20 100644 --- a/examples/postgres/package.json +++ b/examples/postgres/package.json @@ -30,14 +30,14 @@ "url": "https://github.com/open-telemetry/opentelemetry-js/issues" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/exporter-jaeger": "^0.13.0", - "@opentelemetry/exporter-zipkin": "^0.13.0", - "@opentelemetry/node": "^0.13.0", - "@opentelemetry/plugin-http": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/exporter-jaeger": "^0.14.0", + "@opentelemetry/exporter-zipkin": "^0.14.0", + "@opentelemetry/node": "^0.14.0", + "@opentelemetry/plugin-http": "^0.14.0", "@opentelemetry/plugin-pg": "^0.11.0", "@opentelemetry/plugin-pg-pool": "^0.11.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/tracing": "^0.14.0", "express": "^4.17.1", "pg": "^7.12.1" }, diff --git a/examples/react-load/preact/package.json b/examples/react-load/preact/package.json index 2806a3c034..4ac3b95ef3 100644 --- a/examples/react-load/preact/package.json +++ b/examples/react-load/preact/package.json @@ -37,11 +37,11 @@ "sirv-cli": "1.0.3" }, "dependencies": { - "@opentelemetry/context-zone": "^0.13.0", - "@opentelemetry/exporter-collector": "^0.13.0", + "@opentelemetry/context-zone": "^0.14.0", + "@opentelemetry/exporter-collector": "^0.14.0", "@opentelemetry/plugin-react-load": "^0.11.0", - "@opentelemetry/tracing": "^0.13.0", - "@opentelemetry/web": "^0.13.0", + "@opentelemetry/tracing": "^0.14.0", + "@opentelemetry/web": "^0.14.0", "preact": "^10.3.2", "preact-render-to-string": "^5.1.4", "preact-router": "^3.2.1" diff --git a/examples/react-load/react/package.json b/examples/react-load/react/package.json index 6dc5fe02b5..60d6f6e04c 100644 --- a/examples/react-load/react/package.json +++ b/examples/react-load/react/package.json @@ -36,12 +36,12 @@ "ts-loader": "^6.0.4" }, "dependencies": { - "@opentelemetry/context-zone": "^0.13.0", - "@opentelemetry/core": "^0.13.0", - "@opentelemetry/exporter-collector": "^0.13.0", + "@opentelemetry/context-zone": "^0.14.0", + "@opentelemetry/core": "^0.14.0", + "@opentelemetry/exporter-collector": "^0.14.0", "@opentelemetry/plugin-react-load": "^0.11.0", - "@opentelemetry/tracing": "^0.13.0", - "@opentelemetry/web": "^0.13.0", + "@opentelemetry/tracing": "^0.14.0", + "@opentelemetry/web": "^0.14.0", "react": "^16.13.1", "react-dom": "^16.13.1", "react-router-dom": "^5.2.0", diff --git a/examples/redis/package.json b/examples/redis/package.json index 43b24b4bf4..f315f667e6 100644 --- a/examples/redis/package.json +++ b/examples/redis/package.json @@ -30,13 +30,13 @@ "url": "https://github.com/open-telemetry/opentelemetry-js/issues" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/exporter-jaeger": "^0.13.0", - "@opentelemetry/exporter-zipkin": "^0.13.0", - "@opentelemetry/node": "^0.13.0", - "@opentelemetry/plugin-http": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/exporter-jaeger": "^0.14.0", + "@opentelemetry/exporter-zipkin": "^0.14.0", + "@opentelemetry/node": "^0.14.0", + "@opentelemetry/plugin-http": "^0.14.0", "@opentelemetry/plugin-redis": "^0.11.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/tracing": "^0.14.0", "axios": "^0.19.0", "express": "^4.17.1", "redis": "^2.8.0" diff --git a/metapackages/plugins-node-core-and-contrib/package.json b/metapackages/plugins-node-core-and-contrib/package.json index 815eadd006..57fe3a90b9 100644 --- a/metapackages/plugins-node-core-and-contrib/package.json +++ b/metapackages/plugins-node-core-and-contrib/package.json @@ -23,6 +23,6 @@ "@opentelemetry/plugin-pg": "^0.11.0", "@opentelemetry/plugin-pg-pool": "^0.11.0", "@opentelemetry/plugin-redis": "^0.11.0", - "@opentelemetry/plugins-node-core": "^0.13.0" + "@opentelemetry/plugins-node-core": "^0.14.0" } } diff --git a/packages/opentelemetry-host-metrics/package.json b/packages/opentelemetry-host-metrics/package.json index 1107274cee..84d8362a63 100644 --- a/packages/opentelemetry-host-metrics/package.json +++ b/packages/opentelemetry-host-metrics/package.json @@ -42,7 +42,7 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/exporter-prometheus": "^0.13.0", + "@opentelemetry/exporter-prometheus": "^0.14.0", "@types/mocha": "8.0.2", "@types/node": "14.0.27", "@types/sinon": "9.0.4", @@ -61,9 +61,9 @@ "typescript": "3.9.7" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/core": "^0.13.0", - "@opentelemetry/metrics": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/core": "^0.14.0", + "@opentelemetry/metrics": "^0.14.0", "systeminformation": "^4.31.0" } } diff --git a/packages/opentelemetry-host-metrics/src/metric.ts b/packages/opentelemetry-host-metrics/src/metric.ts index 386408bef7..374e9996a9 100644 --- a/packages/opentelemetry-host-metrics/src/metric.ts +++ b/packages/opentelemetry-host-metrics/src/metric.ts @@ -218,7 +218,6 @@ export class HostMetrics extends BaseMetrics { ); this._meter.createBatchObserver( - 'metric_batch_observer', observerBatchResult => { Promise.all([ getMemoryData(), diff --git a/packages/opentelemetry-host-metrics/test/metric.test.ts b/packages/opentelemetry-host-metrics/test/metric.test.ts index 4a59ba179d..2d9c4e5500 100644 --- a/packages/opentelemetry-host-metrics/test/metric.test.ts +++ b/packages/opentelemetry-host-metrics/test/metric.test.ts @@ -151,7 +151,7 @@ describe('Host Metrics', () => { }); it('should export CPU time metrics', () => { - const records = getRecords(exportSpy.args[0][0], 'system.cpu.time'); + const records = getRecords(exportSpy.args[1][0], 'system.cpu.time'); assert.strictEqual(records.length, 3); ensureValue(records[0], { state: 'user' }, 1.899243); ensureValue(records[1], { state: 'system' }, 0.258553); @@ -159,7 +159,7 @@ describe('Host Metrics', () => { }); it('should export CPU utilization metrics', () => { - const records = getRecords(exportSpy.args[0][0], 'system.cpu.utilization'); + const records = getRecords(exportSpy.args[1][0], 'system.cpu.utilization'); assert.strictEqual(records.length, 3); ensureValue(records[0], { state: 'user' }, 0.3165405); ensureValue(records[1], { state: 'system' }, 0.04309216666666666); @@ -167,7 +167,7 @@ describe('Host Metrics', () => { }); it('should export Memory usage metrics', done => { - const records = getRecords(exportSpy.args[0][0], 'system.memory.usage'); + const records = getRecords(exportSpy.args[1][0], 'system.memory.usage'); assert.strictEqual(records.length, 2); ensureValue(records[0], { state: 'used' }, 9999983616); ensureValue(records[1], { state: 'free' }, 7179885568); @@ -176,7 +176,7 @@ describe('Host Metrics', () => { it('should export Memory utilization metrics', done => { const records = getRecords( - exportSpy.args[0][0], + exportSpy.args[1][0], 'system.memory.utilization' ); assert.strictEqual(records.length, 2); @@ -186,7 +186,7 @@ describe('Host Metrics', () => { }); it('should export Network io dropped', done => { - const records = getRecords(exportSpy.args[0][0], 'system.network.dropped'); + const records = getRecords(exportSpy.args[1][0], 'system.network.dropped'); assert.strictEqual(records.length, 2); ensureValue(records[0], { direction: 'receive', device: 'eth0' }, 2400); ensureValue(records[1], { direction: 'transmit', device: 'eth0' }, 24); @@ -194,7 +194,7 @@ describe('Host Metrics', () => { }); it('should export Network io errors', done => { - const records = getRecords(exportSpy.args[0][0], 'system.network.errors'); + const records = getRecords(exportSpy.args[1][0], 'system.network.errors'); assert.strictEqual(records.length, 2); ensureValue(records[0], { direction: 'receive', device: 'eth0' }, 6); ensureValue(records[1], { direction: 'transmit', device: 'eth0' }, 30); @@ -202,7 +202,7 @@ describe('Host Metrics', () => { }); it('should export Network io bytes', done => { - const records = getRecords(exportSpy.args[0][0], 'system.network.io'); + const records = getRecords(exportSpy.args[1][0], 'system.network.io'); assert.strictEqual(records.length, 2); ensureValue(records[0], { direction: 'receive', device: 'eth0' }, 246246); ensureValue(records[1], { direction: 'transmit', device: 'eth0' }, 642642); diff --git a/packages/opentelemetry-test-utils/package.json b/packages/opentelemetry-test-utils/package.json index 965c67b77e..8cd1b785cd 100644 --- a/packages/opentelemetry-test-utils/package.json +++ b/packages/opentelemetry-test-utils/package.json @@ -32,8 +32,8 @@ "typescript": "3.9.6" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/core": "^0.13.0", - "@opentelemetry/tracing": "^0.13.0" + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/core": "^0.14.0", + "@opentelemetry/tracing": "^0.14.0" } } diff --git a/plugins/node/opentelemetry-hapi-instrumentation/package.json b/plugins/node/opentelemetry-hapi-instrumentation/package.json index 23d8b275ef..4a506f628d 100644 --- a/plugins/node/opentelemetry-hapi-instrumentation/package.json +++ b/plugins/node/opentelemetry-hapi-instrumentation/package.json @@ -42,9 +42,9 @@ }, "devDependencies": { "@hapi/hapi": "20.0.1", - "@opentelemetry/context-async-hooks": "^0.13.0", - "@opentelemetry/node": "^0.13.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/context-async-hooks": "^0.14.0", + "@opentelemetry/node": "^0.14.0", + "@opentelemetry/tracing": "^0.14.0", "@types/hapi__hapi": "20.0.1", "@types/mocha": "7.0.2", "@types/node": "12.12.47", @@ -64,9 +64,9 @@ "typescript": "3.9.6" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/core": "^0.13.0", - "@opentelemetry/semantic-conventions": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/core": "^0.14.0", + "@opentelemetry/semantic-conventions": "^0.14.0", "shimmer": "^1.2.1" } } diff --git a/plugins/node/opentelemetry-instrumentation-graphql/package.json b/plugins/node/opentelemetry-instrumentation-graphql/package.json index bfba544dcd..dce4a52583 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/package.json +++ b/plugins/node/opentelemetry-instrumentation-graphql/package.json @@ -43,7 +43,7 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/tracing": "^0.14.0", "@types/graphql": "14.5.0", "@types/mocha": "8.0.1", "@types/node": "14.0.27", @@ -61,7 +61,7 @@ "typescript": "3.9.7" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/instrumentation": "^0.13.0" + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/instrumentation": "^0.14.0" } } diff --git a/plugins/node/opentelemetry-koa-instrumentation/package.json b/plugins/node/opentelemetry-koa-instrumentation/package.json index d32eb7b48a..2403c0e547 100644 --- a/plugins/node/opentelemetry-koa-instrumentation/package.json +++ b/plugins/node/opentelemetry-koa-instrumentation/package.json @@ -44,9 +44,9 @@ }, "devDependencies": { "@koa/router": "9.4.0", - "@opentelemetry/context-async-hooks": "^0.13.0", - "@opentelemetry/node": "^0.13.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/context-async-hooks": "^0.14.0", + "@opentelemetry/node": "^0.14.0", + "@opentelemetry/tracing": "^0.14.0", "@types/koa": "2.11.4", "@types/koa__router": "8.0.2", "@types/mocha": "7.0.2", @@ -67,9 +67,9 @@ "typescript": "3.9.6" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/core": "^0.13.0", - "@opentelemetry/semantic-conventions": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/core": "^0.14.0", + "@opentelemetry/semantic-conventions": "^0.14.0", "shimmer": "^1.2.1" } } diff --git a/plugins/node/opentelemetry-plugin-dns/package.json b/plugins/node/opentelemetry-plugin-dns/package.json index 3d4082c668..6a1826eff4 100644 --- a/plugins/node/opentelemetry-plugin-dns/package.json +++ b/plugins/node/opentelemetry-plugin-dns/package.json @@ -41,8 +41,8 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/node": "^0.13.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/node": "^0.14.0", + "@opentelemetry/tracing": "^0.14.0", "@types/mocha": "7.0.2", "@types/node": "14.0.27", "@types/semver": "7.3.1", @@ -61,8 +61,8 @@ "typescript": "3.9.7" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/core": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/core": "^0.14.0", "semver": "^7.3.2", "shimmer": "^1.2.1" } diff --git a/plugins/node/opentelemetry-plugin-dns/src/types.ts b/plugins/node/opentelemetry-plugin-dns/src/types.ts index 623a2a7b77..33c19642f1 100644 --- a/plugins/node/opentelemetry-plugin-dns/src/types.ts +++ b/plugins/node/opentelemetry-plugin-dns/src/types.ts @@ -15,7 +15,7 @@ */ import * as dns from 'dns'; -import { PluginConfig } from '@opentelemetry/api'; +import { PluginConfig } from '@opentelemetry/core'; export type Dns = typeof dns; diff --git a/plugins/node/opentelemetry-plugin-express/package.json b/plugins/node/opentelemetry-plugin-express/package.json index 3f585c597e..515cad77e6 100644 --- a/plugins/node/opentelemetry-plugin-express/package.json +++ b/plugins/node/opentelemetry-plugin-express/package.json @@ -42,9 +42,9 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/context-async-hooks": "^0.13.0", - "@opentelemetry/node": "^0.13.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/context-async-hooks": "^0.14.0", + "@opentelemetry/node": "^0.14.0", + "@opentelemetry/tracing": "^0.14.0", "@types/express": "4.17.7", "@types/mocha": "7.0.2", "@types/node": "14.0.27", @@ -62,8 +62,8 @@ "typescript": "3.9.7" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/core": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/core": "^0.14.0", "shimmer": "^1.2.1" } } diff --git a/plugins/node/opentelemetry-plugin-express/src/types.ts b/plugins/node/opentelemetry-plugin-express/src/types.ts index 1374a90bb0..c4bde0108a 100644 --- a/plugins/node/opentelemetry-plugin-express/src/types.ts +++ b/plugins/node/opentelemetry-plugin-express/src/types.ts @@ -16,7 +16,8 @@ import { kLayerPatched } from './express'; import { Request } from 'express'; -import { PluginConfig, Attributes } from '@opentelemetry/api'; +import { Attributes } from '@opentelemetry/api'; +import { PluginConfig } from '@opentelemetry/core'; /** * This const define where on the `request` object the plugin will mount the diff --git a/plugins/node/opentelemetry-plugin-ioredis/package.json b/plugins/node/opentelemetry-plugin-ioredis/package.json index 0752c9799f..9bf10027f5 100644 --- a/plugins/node/opentelemetry-plugin-ioredis/package.json +++ b/plugins/node/opentelemetry-plugin-ioredis/package.json @@ -44,11 +44,11 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/context-async-hooks": "^0.13.0", - "@opentelemetry/node": "^0.13.0", - "@opentelemetry/semantic-conventions": "^0.13.0", + "@opentelemetry/context-async-hooks": "^0.14.0", + "@opentelemetry/node": "^0.14.0", + "@opentelemetry/semantic-conventions": "^0.14.0", "@opentelemetry/test-utils": "^0.11.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/tracing": "^0.14.0", "@types/ioredis": "4.17.3", "@types/mocha": "7.0.2", "@types/node": "14.0.27", @@ -67,8 +67,8 @@ "typescript": "3.9.7" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/core": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/core": "^0.14.0", "shimmer": "^1.2.1" } } diff --git a/plugins/node/opentelemetry-plugin-ioredis/src/types.ts b/plugins/node/opentelemetry-plugin-ioredis/src/types.ts index 073e3897dc..b8d7aad62c 100644 --- a/plugins/node/opentelemetry-plugin-ioredis/src/types.ts +++ b/plugins/node/opentelemetry-plugin-ioredis/src/types.ts @@ -15,7 +15,7 @@ */ import type * as ioredisTypes from 'ioredis'; -import { PluginConfig } from '@opentelemetry/api'; +import { PluginConfig } from '@opentelemetry/core'; export interface IoredisCommand { reject: (err: Error) => void; diff --git a/plugins/node/opentelemetry-plugin-mongodb/package.json b/plugins/node/opentelemetry-plugin-mongodb/package.json index 006381aa24..0988a1863b 100644 --- a/plugins/node/opentelemetry-plugin-mongodb/package.json +++ b/plugins/node/opentelemetry-plugin-mongodb/package.json @@ -41,10 +41,10 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/context-async-hooks": "^0.13.0", - "@opentelemetry/node": "^0.13.0", - "@opentelemetry/semantic-conventions": "^0.13.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/context-async-hooks": "^0.14.0", + "@opentelemetry/node": "^0.14.0", + "@opentelemetry/semantic-conventions": "^0.14.0", + "@opentelemetry/tracing": "^0.14.0", "@types/mocha": "7.0.2", "@types/mongodb": "3.5.25", "@types/node": "14.0.27", @@ -62,8 +62,8 @@ "typescript": "3.9.7" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/core": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/core": "^0.14.0", "shimmer": "^1.2.1" } } diff --git a/plugins/node/opentelemetry-plugin-mongodb/test/mongodb.test.ts b/plugins/node/opentelemetry-plugin-mongodb/test/mongodb.test.ts index 1168281573..4157bb074a 100644 --- a/plugins/node/opentelemetry-plugin-mongodb/test/mongodb.test.ts +++ b/plugins/node/opentelemetry-plugin-mongodb/test/mongodb.test.ts @@ -17,8 +17,8 @@ // for testing locally use this command to run docker // docker run -e MONGODB_DB=opentelemetry-tests -e MONGODB_PORT=27017 -e MONGODB_HOST=localhost -p 27017:27017 --name otmongo mongo -import { context, PluginConfig, SpanKind } from '@opentelemetry/api'; -import { NoopLogger } from '@opentelemetry/core'; +import { context, SpanKind } from '@opentelemetry/api'; +import { NoopLogger, PluginConfig } from '@opentelemetry/core'; import { BasicTracerProvider } from '@opentelemetry/tracing'; import { AsyncHooksContextManager } from '@opentelemetry/context-async-hooks'; import { diff --git a/plugins/node/opentelemetry-plugin-mysql/package.json b/plugins/node/opentelemetry-plugin-mysql/package.json index 994453a53b..adf157e59c 100644 --- a/plugins/node/opentelemetry-plugin-mysql/package.json +++ b/plugins/node/opentelemetry-plugin-mysql/package.json @@ -41,11 +41,11 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/context-async-hooks": "^0.13.0", - "@opentelemetry/node": "^0.13.0", - "@opentelemetry/semantic-conventions": "^0.13.0", + "@opentelemetry/context-async-hooks": "^0.14.0", + "@opentelemetry/node": "^0.14.0", + "@opentelemetry/semantic-conventions": "^0.14.0", "@opentelemetry/test-utils": "^0.11.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/tracing": "^0.14.0", "@types/mocha": "7.0.2", "@types/mysql": "2.15.15", "@types/node": "14.0.27", @@ -63,8 +63,8 @@ "typescript": "3.9.7" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/core": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/core": "^0.14.0", "shimmer": "^1.2.1" } } diff --git a/plugins/node/opentelemetry-plugin-pg-pool/package.json b/plugins/node/opentelemetry-plugin-pg-pool/package.json index 43ed437d4c..888efa5d41 100644 --- a/plugins/node/opentelemetry-plugin-pg-pool/package.json +++ b/plugins/node/opentelemetry-plugin-pg-pool/package.json @@ -47,10 +47,10 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/context-async-hooks": "^0.13.0", + "@opentelemetry/context-async-hooks": "^0.14.0", "@opentelemetry/plugin-pg": "^0.11.0", "@opentelemetry/test-utils": "^0.11.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/tracing": "^0.14.0", "@types/mocha": "7.0.2", "@types/node": "14.0.27", "@types/pg": "7.14.4", @@ -71,8 +71,8 @@ "typescript": "3.9.7" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/core": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/core": "^0.14.0", "shimmer": "^1.2.1" } } diff --git a/plugins/node/opentelemetry-plugin-pg/package.json b/plugins/node/opentelemetry-plugin-pg/package.json index ce368e54de..5b44b7d5eb 100644 --- a/plugins/node/opentelemetry-plugin-pg/package.json +++ b/plugins/node/opentelemetry-plugin-pg/package.json @@ -46,10 +46,10 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/context-async-hooks": "^0.13.0", - "@opentelemetry/node": "^0.13.0", + "@opentelemetry/context-async-hooks": "^0.14.0", + "@opentelemetry/node": "^0.14.0", "@opentelemetry/test-utils": "^0.11.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/tracing": "^0.14.0", "@types/mocha": "7.0.2", "@types/node": "14.0.27", "@types/pg": "7.14.4", @@ -68,8 +68,8 @@ "typescript": "3.9.7" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/core": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/core": "^0.14.0", "shimmer": "^1.2.1" } } diff --git a/plugins/node/opentelemetry-plugin-pg/src/utils.ts b/plugins/node/opentelemetry-plugin-pg/src/utils.ts index d47e89c7fb..bfbae52179 100644 --- a/plugins/node/opentelemetry-plugin-pg/src/utils.ts +++ b/plugins/node/opentelemetry-plugin-pg/src/utils.ts @@ -14,13 +14,8 @@ * limitations under the License. */ -import { - Span, - StatusCode, - Tracer, - SpanKind, - PluginConfig, -} from '@opentelemetry/api'; +import { Span, StatusCode, Tracer, SpanKind } from '@opentelemetry/api'; +import { PluginConfig } from '@opentelemetry/core'; import { AttributeNames } from './enums'; import { PgClientExtended, diff --git a/plugins/node/opentelemetry-plugin-pg/test/utils.test.ts b/plugins/node/opentelemetry-plugin-pg/test/utils.test.ts index f6c8d4be96..50b3829b2f 100644 --- a/plugins/node/opentelemetry-plugin-pg/test/utils.test.ts +++ b/plugins/node/opentelemetry-plugin-pg/test/utils.test.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -import { context, PluginConfig } from '@opentelemetry/api'; +import { context } from '@opentelemetry/api'; +import { PluginConfig } from '@opentelemetry/core'; import { AsyncHooksContextManager } from '@opentelemetry/context-async-hooks'; import { BasicTracerProvider, diff --git a/plugins/node/opentelemetry-plugin-redis/package.json b/plugins/node/opentelemetry-plugin-redis/package.json index 749706ee26..fc1d2d2bf8 100644 --- a/plugins/node/opentelemetry-plugin-redis/package.json +++ b/plugins/node/opentelemetry-plugin-redis/package.json @@ -43,11 +43,11 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/context-async-hooks": "^0.13.0", - "@opentelemetry/node": "^0.13.0", - "@opentelemetry/semantic-conventions": "^0.13.0", + "@opentelemetry/context-async-hooks": "^0.14.0", + "@opentelemetry/node": "^0.14.0", + "@opentelemetry/semantic-conventions": "^0.14.0", "@opentelemetry/test-utils": "^0.11.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/tracing": "^0.14.0", "@types/mocha": "7.0.2", "@types/node": "14.0.27", "@types/redis": "2.8.25", @@ -66,8 +66,8 @@ "typescript": "3.9.7" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/core": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/core": "^0.14.0", "shimmer": "^1.2.1" } } diff --git a/plugins/web/opentelemetry-plugin-document-load/package.json b/plugins/web/opentelemetry-plugin-document-load/package.json index 76dd12e607..e801989251 100644 --- a/plugins/web/opentelemetry-plugin-document-load/package.json +++ b/plugins/web/opentelemetry-plugin-document-load/package.json @@ -72,10 +72,10 @@ "webpack-merge": "5.0.9" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/core": "^0.13.0", - "@opentelemetry/semantic-conventions": "^0.13.0", - "@opentelemetry/tracing": "^0.13.0", - "@opentelemetry/web": "^0.13.0" + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/core": "^0.14.0", + "@opentelemetry/semantic-conventions": "^0.14.0", + "@opentelemetry/tracing": "^0.14.0", + "@opentelemetry/web": "^0.14.0" } } diff --git a/plugins/web/opentelemetry-plugin-document-load/src/documentLoad.ts b/plugins/web/opentelemetry-plugin-document-load/src/documentLoad.ts index b8e64e3a4f..ee4ab26a5e 100644 --- a/plugins/web/opentelemetry-plugin-document-load/src/documentLoad.ts +++ b/plugins/web/opentelemetry-plugin-document-load/src/documentLoad.ts @@ -16,14 +16,15 @@ import { context, - PluginConfig, propagation, setActiveSpan, Span, + ROOT_CONTEXT, } from '@opentelemetry/api'; import { BasePlugin, otperformance, + PluginConfig, TRACE_PARENT_HEADER, } from '@opentelemetry/core'; import { @@ -93,7 +94,7 @@ export class DocumentLoad extends BasePlugin { const entries = this._getEntries(); const traceparent = (metaElement && metaElement.content) || ''; - context.with(propagation.extract({ traceparent }), () => { + context.with(propagation.extract(ROOT_CONTEXT, { traceparent }), () => { const rootSpan = this._startSpan( AttributeNames.DOCUMENT_LOAD, PTN.FETCH_START, diff --git a/plugins/web/opentelemetry-plugin-document-load/test/documentLoad.test.ts b/plugins/web/opentelemetry-plugin-document-load/test/documentLoad.test.ts index 609cda203a..efa8f892f2 100644 --- a/plugins/web/opentelemetry-plugin-document-load/test/documentLoad.test.ts +++ b/plugins/web/opentelemetry-plugin-document-load/test/documentLoad.test.ts @@ -14,16 +14,11 @@ * limitations under the License. */ -import { - context, - Logger, - PluginConfig, - propagation, - TimedEvent, -} from '@opentelemetry/api'; +import { context, Logger, propagation, TimedEvent } from '@opentelemetry/api'; import { ConsoleLogger, HttpTraceContext, + PluginConfig, TRACE_PARENT_HEADER, } from '@opentelemetry/core'; import { diff --git a/plugins/web/opentelemetry-plugin-react-load/package.json b/plugins/web/opentelemetry-plugin-react-load/package.json index 4282ad29cf..f1439c99c5 100644 --- a/plugins/web/opentelemetry-plugin-react-load/package.json +++ b/plugins/web/opentelemetry-plugin-react-load/package.json @@ -51,7 +51,7 @@ "@types/shimmer": "1.0.1", "@types/sinon": "9.0.4", "@types/webpack-env": "1.15.2", - "@opentelemetry/propagator-b3": "^0.13.0", + "@opentelemetry/propagator-b3": "^0.14.0", "babel-loader": "8.1.0", "codecov": "3.7.0", "gts": "2.0.2", @@ -82,12 +82,12 @@ "react": "^16.13.1 || ^17.0.0" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/context-zone": "^0.13.0", - "@opentelemetry/core": "^0.13.0", - "@opentelemetry/semantic-conventions": "^0.13.0", - "@opentelemetry/tracing": "^0.13.0", - "@opentelemetry/web": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/context-zone": "^0.14.0", + "@opentelemetry/core": "^0.14.0", + "@opentelemetry/semantic-conventions": "^0.14.0", + "@opentelemetry/tracing": "^0.14.0", + "@opentelemetry/web": "^0.14.0", "shimmer": "^1.2.1" } } diff --git a/plugins/web/opentelemetry-plugin-user-interaction/package.json b/plugins/web/opentelemetry-plugin-user-interaction/package.json index d83ed0f666..c6ff7eaba6 100644 --- a/plugins/web/opentelemetry-plugin-user-interaction/package.json +++ b/plugins/web/opentelemetry-plugin-user-interaction/package.json @@ -43,10 +43,10 @@ }, "devDependencies": { "@babel/core": "7.11.1", - "@opentelemetry/context-base": "^0.13.0", - "@opentelemetry/context-zone-peer-dep": "^0.13.0", - "@opentelemetry/instrumentation-xml-http-request": "^0.13.0", - "@opentelemetry/tracing": "^0.13.0", + "@opentelemetry/context-base": "^0.14.0", + "@opentelemetry/context-zone-peer-dep": "^0.14.0", + "@opentelemetry/instrumentation-xml-http-request": "^0.14.0", + "@opentelemetry/tracing": "^0.14.0", "@types/jquery": "3.5.1", "@types/mocha": "7.0.2", "@types/node": "14.0.27", @@ -80,9 +80,9 @@ "zone.js": "0.10.3" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/core": "^0.13.0", - "@opentelemetry/web": "^0.13.0", + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/core": "^0.14.0", + "@opentelemetry/web": "^0.14.0", "shimmer": "^1.2.1" }, "peerDependencies": { diff --git a/propagators/opentelemetry-propagator-grpc-census-binary/package.json b/propagators/opentelemetry-propagator-grpc-census-binary/package.json index a5db7247e3..8abeb46771 100644 --- a/propagators/opentelemetry-propagator-grpc-census-binary/package.json +++ b/propagators/opentelemetry-propagator-grpc-census-binary/package.json @@ -58,7 +58,7 @@ "typescript": "3.9.7" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/core": "^0.13.0" + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/core": "^0.14.0" } } diff --git a/propagators/opentelemetry-propagator-jaeger/package.json b/propagators/opentelemetry-propagator-jaeger/package.json index 972f500590..7652cb95cb 100644 --- a/propagators/opentelemetry-propagator-jaeger/package.json +++ b/propagators/opentelemetry-propagator-jaeger/package.json @@ -70,7 +70,7 @@ "webpack": "4.43.0" }, "dependencies": { - "@opentelemetry/api": "^0.13.0", - "@opentelemetry/core": "^0.13.0" + "@opentelemetry/api": "^0.14.0", + "@opentelemetry/core": "^0.14.0" } } From b60161ef7773381ce432d31d820f4f14b6369644 Mon Sep 17 00:00:00 2001 From: Gerhard Stoebich <18708370+Flarna@users.noreply.github.com> Date: Fri, 18 Dec 2020 16:04:43 +0100 Subject: [PATCH 2/2] fixup! correct host metrics test --- .../test/metric.test.ts | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/opentelemetry-host-metrics/test/metric.test.ts b/packages/opentelemetry-host-metrics/test/metric.test.ts index 2d9c4e5500..c471d73647 100644 --- a/packages/opentelemetry-host-metrics/test/metric.test.ts +++ b/packages/opentelemetry-host-metrics/test/metric.test.ts @@ -115,7 +115,7 @@ describe('Host Metrics', () => { // sinon fake doesn't work fine with setImmediate originalSetTimeout(() => { // move the clock with the same value as interval - sandbox.clock.tick(INTERVAL * 2); + sandbox.clock.tick(INTERVAL * 1); // move to "real" next tick so that async batcher observer will start // processing metrics originalSetTimeout(() => { @@ -151,61 +151,61 @@ describe('Host Metrics', () => { }); it('should export CPU time metrics', () => { - const records = getRecords(exportSpy.args[1][0], 'system.cpu.time'); + const records = getRecords(exportSpy.args[0][0], 'system.cpu.time'); assert.strictEqual(records.length, 3); ensureValue(records[0], { state: 'user' }, 1.899243); ensureValue(records[1], { state: 'system' }, 0.258553); - ensureValue(records[2], { state: 'idle' }, 3.8422039999999997); + ensureValue(records[2], { state: 'idle' }, 0.842204); }); it('should export CPU utilization metrics', () => { - const records = getRecords(exportSpy.args[1][0], 'system.cpu.utilization'); + const records = getRecords(exportSpy.args[0][0], 'system.cpu.utilization'); assert.strictEqual(records.length, 3); - ensureValue(records[0], { state: 'user' }, 0.3165405); - ensureValue(records[1], { state: 'system' }, 0.04309216666666666); - ensureValue(records[2], { state: 'idle' }, 0.6403673333333333); + ensureValue(records[0], { state: 'user' }, 0.633081); + ensureValue(records[1], { state: 'system' }, 0.08618433333333332); + ensureValue(records[2], { state: 'idle' }, 0.28073466666666663); }); it('should export Memory usage metrics', done => { - const records = getRecords(exportSpy.args[1][0], 'system.memory.usage'); + const records = getRecords(exportSpy.args[0][0], 'system.memory.usage'); assert.strictEqual(records.length, 2); - ensureValue(records[0], { state: 'used' }, 9999983616); - ensureValue(records[1], { state: 'free' }, 7179885568); + ensureValue(records[0], { state: 'used' }, 9999988736); + ensureValue(records[1], { state: 'free' }, 7179880448); done(); }); it('should export Memory utilization metrics', done => { const records = getRecords( - exportSpy.args[1][0], + exportSpy.args[0][0], 'system.memory.utilization' ); assert.strictEqual(records.length, 2); - ensureValue(records[0], { state: 'used' }, 0.5820754766464233); - ensureValue(records[1], { state: 'free' }, 0.41792452335357666); + ensureValue(records[0], { state: 'used' }, 0.582075834274292); + ensureValue(records[1], { state: 'free' }, 0.417924165725708); done(); }); it('should export Network io dropped', done => { - const records = getRecords(exportSpy.args[1][0], 'system.network.dropped'); + const records = getRecords(exportSpy.args[0][0], 'system.network.dropped'); assert.strictEqual(records.length, 2); - ensureValue(records[0], { direction: 'receive', device: 'eth0' }, 2400); - ensureValue(records[1], { direction: 'transmit', device: 'eth0' }, 24); + ensureValue(records[0], { direction: 'receive', device: 'eth0' }, 1200); + ensureValue(records[1], { direction: 'transmit', device: 'eth0' }, 12); done(); }); it('should export Network io errors', done => { - const records = getRecords(exportSpy.args[1][0], 'system.network.errors'); + const records = getRecords(exportSpy.args[0][0], 'system.network.errors'); assert.strictEqual(records.length, 2); - ensureValue(records[0], { direction: 'receive', device: 'eth0' }, 6); - ensureValue(records[1], { direction: 'transmit', device: 'eth0' }, 30); + ensureValue(records[0], { direction: 'receive', device: 'eth0' }, 3); + ensureValue(records[1], { direction: 'transmit', device: 'eth0' }, 15); done(); }); it('should export Network io bytes', done => { - const records = getRecords(exportSpy.args[1][0], 'system.network.io'); + const records = getRecords(exportSpy.args[0][0], 'system.network.io'); assert.strictEqual(records.length, 2); - ensureValue(records[0], { direction: 'receive', device: 'eth0' }, 246246); - ensureValue(records[1], { direction: 'transmit', device: 'eth0' }, 642642); + ensureValue(records[0], { direction: 'receive', device: 'eth0' }, 123123); + ensureValue(records[1], { direction: 'transmit', device: 'eth0' }, 321321); done(); }); });