Skip to content

Commit

Permalink
chore: update to OTel v0.14.0 (#283)
Browse files Browse the repository at this point in the history
* chore: update to OTel v0.14.0

Update all dependencies to 0.14.0 and adapt code to changed APIs.

* fixup! correct host metrics test
  • Loading branch information
Flarna authored Dec 18, 2020
1 parent 19f4319 commit 3135451
Show file tree
Hide file tree
Showing 43 changed files with 193 additions and 201 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
}
10 changes: 5 additions & 5 deletions examples/dns/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
12 changes: 6 additions & 6 deletions examples/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
12 changes: 6 additions & 6 deletions examples/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions examples/grpc-census-prop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
12 changes: 6 additions & 6 deletions examples/hapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions examples/host-metrics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
8 changes: 4 additions & 4 deletions examples/ioredis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions examples/koa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
12 changes: 6 additions & 6 deletions examples/mysql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions examples/postgres/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
8 changes: 4 additions & 4 deletions examples/react-load/preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions examples/react-load/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions examples/redis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion metapackages/plugins-node-core-and-contrib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
8 changes: 4 additions & 4 deletions packages/opentelemetry-host-metrics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
}
1 change: 0 additions & 1 deletion packages/opentelemetry-host-metrics/src/metric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ export class HostMetrics extends BaseMetrics {
);

this._meter.createBatchObserver(
'metric_batch_observer',
observerBatchResult => {
Promise.all([
getMemoryData(),
Expand Down
30 changes: 15 additions & 15 deletions packages/opentelemetry-host-metrics/test/metric.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down Expand Up @@ -155,22 +155,22 @@ describe('Host Metrics', () => {
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[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[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();
});

Expand All @@ -180,32 +180,32 @@ describe('Host Metrics', () => {
'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[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[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[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();
});
});
Expand Down
6 changes: 3 additions & 3 deletions packages/opentelemetry-test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Loading

0 comments on commit 3135451

Please sign in to comment.