Skip to content

Commit

Permalink
updating to core v.0.13.0 (#277)
Browse files Browse the repository at this point in the history
* chore: updating to core version 0.13.0

* chore: updating main packages to v013

* chore: adding link for todo

* chore: updating cases for status code

* chore: removing not needed function

* chore: fixing status for span

* chore: fixing status for span

* chore: cleanup

* chore: fixing tests
  • Loading branch information
obecny authored Dec 17, 2020
1 parent 49db1b2 commit 19f4319
Show file tree
Hide file tree
Showing 74 changed files with 518 additions and 484 deletions.
5 changes: 5 additions & 0 deletions .circleci/checksum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ fi

openssl md5 package.json >> $FILE

find detectors/node/*/package.json | xargs -I{} openssl md5 {} >> $FILE
find metapackages/*/package.json | xargs -I{} openssl md5 {} >> $FILE
find packages/*/package.json | xargs -I{} openssl md5 {} >> $FILE
find plugins/node/*/package.json | xargs -I{} openssl md5 {} >> $FILE
find plugins/web/*/package.json | xargs -I{} openssl md5 {} >> $FILE
find propagators/*/package.json | xargs -I{} openssl md5 {} >> $FILE

sort -o $FILE $FILE
18 changes: 14 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,26 @@ cache_1: &cache_1
paths:
- ./node_modules
- ./package-lock.json
- detectors/node/opentelemetry-resource-detector-github/node_modules
- metapackages/plugins-node-core-and-contrib/node_modules
- packages/opentelemetry-host-metrics/node_modules
- packages/opentelemetry-test-utils/node_modules
- plugins/node/opentelemetry-hapi-instrumentation/node_modules
- plugins/node/opentelemetry-instrumentation-graphql/node_modules
- plugins/node/opentelemetry-koa-instrumentation/node_modules
- plugins/node/opentelemetry-plugin-dns/node_modules
- plugins/node/opentelemetry-plugin-express/node_modules
- plugins/node/opentelemetry-plugin-ioredis/node_modules
- plugins/node/opentelemetry-plugin-mongodb/node_modules
- plugins/node/opentelemetry-plugin-redis/node_modules
- plugins/node/opentelemetry-plugin-mysql/node_modules
- plugins/node/opentelemetry-plugin-pg/node_modules
- plugins/node/opentelemetry-plugin-document-load/node_modules
- plugins/node/opentelemetry-plugin-pg-pool/node_modules
- plugins/node/opentelemetry-plugin-mysql/node_modules
- plugins/node/opentelemetry-plugin-express/node_modules
- plugins/node/opentelemetry-plugin-redis/node_modules
- plugins/web/opentelemetry-plugin-document-load/node_modules
- plugins/web/opentelemetry-plugin-react-load/node_modules
- plugins/web/opentelemetry-plugin-user-interaction/node_modules
- propagators/opentelemetry-propagator-jaeger/node_modules
- propagators/opentelemetry-propagator-grpc-census-binary/node_modules

node_unit_tests: &node_unit_tests
resource_class: large
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ jobs:
id: cache
with:
path: |
./node_modules
./package-lock.json
node_modules
packages/*/node_modules
detectors/node/*/node_modules
metapackages/*/node_modules
packages/*/node_modules
plugins/node/*/node_modules
plugins/web/*/node_modules
propagators/*/node_modules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"access": "public"
},
"devDependencies": {
"@opentelemetry/core": "^0.12.0",
"@opentelemetry/tracing": "^0.12.0",
"@opentelemetry/core": "^0.13.0",
"@opentelemetry/tracing": "^0.13.0",
"@types/mocha": "8.0.1",
"@types/node": "14.0.27",
"@types/sinon": "9.0.4",
Expand All @@ -55,13 +55,13 @@
"nyc": "15.1.0",
"rimraf": "3.0.2",
"sinon": "9.0.2",
"ts-mocha": "7.0.0",
"ts-mocha": "8.0.0",
"ts-node": "8.10.2",
"typescript": "3.9.7"
},
"dependencies": {
"@opentelemetry/api": "^0.12.0",
"@opentelemetry/core": "^0.12.0",
"@opentelemetry/resources": "^0.12.0"
"@opentelemetry/api": "^0.13.0",
"@opentelemetry/core": "^0.13.0",
"@opentelemetry/resources": "^0.13.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.12.0",
"@opentelemetry/exporter-jaeger": "^0.12.0",
"@opentelemetry/exporter-zipkin": "^0.12.0",
"@opentelemetry/node": "^0.12.0",
"@opentelemetry/api": "^0.13.0",
"@opentelemetry/exporter-jaeger": "^0.13.0",
"@opentelemetry/exporter-zipkin": "^0.13.0",
"@opentelemetry/node": "^0.13.0",
"@opentelemetry/plugin-dns": "^0.11.0",
"@opentelemetry/tracing": "^0.12.0"
"@opentelemetry/tracing": "^0.13.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme",
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions examples/express/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ function makeRequest() {
tracer.withSpan(span, async () => {
try {
const res = await axios.get('http://localhost:8080/run_test');
span.setStatus({ code: api.CanonicalCode.OK });
span.setStatus({ code: api.StatusCode.OK });
console.log(res.statusText);
} catch (e) {
span.setStatus({ code: api.CanonicalCode.UNKNOWN, message: e.message });
span.setStatus({ code: api.StatusCode.ERROR, message: e.message });
}
span.end();
console.log('Sleeping 5 seconds before shutdown to ensure all records are flushed.');
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.12.0",
"@opentelemetry/exporter-jaeger": "^0.12.0",
"@opentelemetry/exporter-zipkin": "^0.12.0",
"@opentelemetry/node": "^0.12.0",
"@opentelemetry/api": "^0.13.0",
"@opentelemetry/exporter-jaeger": "^0.13.0",
"@opentelemetry/exporter-zipkin": "^0.13.0",
"@opentelemetry/node": "^0.13.0",
"@opentelemetry/plugin-express": "^0.11.0",
"@opentelemetry/plugin-http": "^0.12.0",
"@opentelemetry/tracing": "^0.12.0",
"@opentelemetry/plugin-http": "^0.13.0",
"@opentelemetry/tracing": "^0.13.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.12.0",
"@opentelemetry/exporter-collector": "^0.12.0",
"@opentelemetry/node": "^0.12.0",
"@opentelemetry/api": "^0.13.0",
"@opentelemetry/exporter-collector": "^0.13.0",
"@opentelemetry/node": "^0.13.0",
"@opentelemetry/plugin-express": "^0.11.0",
"@opentelemetry/instrumentation-graphql": "^0.11.0",
"@opentelemetry/plugin-http": "^0.12.0",
"@opentelemetry/plugin-https": "^0.12.0",
"@opentelemetry/tracing": "^0.12.0",
"@opentelemetry/plugin-http": "^0.13.0",
"@opentelemetry/plugin-https": "^0.13.0",
"@opentelemetry/tracing": "^0.13.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.12.0",
"@opentelemetry/core": "^0.12.0",
"@opentelemetry/node": "^0.12.0",
"@opentelemetry/plugin-grpc": "^0.12.0",
"@opentelemetry/api": "^0.13.0",
"@opentelemetry/core": "^0.13.0",
"@opentelemetry/node": "^0.13.0",
"@opentelemetry/plugin-grpc": "^0.13.0",
"@opentelemetry/propagator-grpc-census-binary": "^0.11.0",
"@opentelemetry/tracing": "^0.12.0",
"@opentelemetry/tracing": "^0.13.0",
"grpc": "^1.24.2",
"node-pre-gyp": "0.12.0"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/hapi/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ function makeRequest() {
tracer.withSpan(span, async () => {
try {
const res = await axios.get('http://localhost:8081/run_test');
span.setStatus({ code: api.CanonicalCode.OK });
span.setStatus({ code: api.StatusCode.OK });
console.log(res.statusText);
} catch (e) {
span.setStatus({ code: api.CanonicalCode.UNKNOWN, message: e.message });
span.setStatus({ code: api.StatusCode.ERROR, message: e.message });
}
span.end();
console.log('Sleeping 5 seconds before shutdown to ensure all records are flushed.');
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.12.0",
"@opentelemetry/exporter-jaeger": "^0.12.0",
"@opentelemetry/exporter-zipkin": "^0.12.0",
"@opentelemetry/api": "^0.13.0",
"@opentelemetry/exporter-jaeger": "^0.13.0",
"@opentelemetry/exporter-zipkin": "^0.13.0",
"@opentelemetry/hapi-instrumentation": "^0.11.0",
"@opentelemetry/node": "^0.12.0",
"@opentelemetry/plugin-http": "^0.12.0",
"@opentelemetry/tracing": "^0.12.0",
"@opentelemetry/node": "^0.13.0",
"@opentelemetry/plugin-http": "^0.13.0",
"@opentelemetry/tracing": "^0.13.0",
"axios": "^0.19.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib#readme",
Expand Down
6 changes: 3 additions & 3 deletions examples/host-metrics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"dependencies": {
"@opentelemetry/api": "^0.13.0",
"@opentelemetry/core": "^0.13.0",
"@opentelemetry/exporter-prometheus": "^0.13.0",
"@opentelemetry/exporter-collector": "^0.13.0",
"@opentelemetry/metrics": "^0.13.0",
"@opentelemetry/host-metrics": "^0.11.0"
"@opentelemetry/exporter-prometheus": "^0.13.0",
"@opentelemetry/host-metrics": "^0.11.0",
"@opentelemetry/metrics": "^0.13.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.12.0",
"@opentelemetry/exporter-jaeger": "^0.12.0",
"@opentelemetry/node": "^0.12.0",
"@opentelemetry/api": "^0.13.0",
"@opentelemetry/exporter-jaeger": "^0.13.0",
"@opentelemetry/node": "^0.13.0",
"@opentelemetry/plugin-ioredis": "^0.11.0",
"@opentelemetry/tracing": "^0.12.0",
"@opentelemetry/tracing": "^0.13.0",
"ioredis": "^4.14.1"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme"
Expand Down
4 changes: 2 additions & 2 deletions examples/koa/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ function makeRequest() {
tracer.withSpan(span, async () => {
try {
const res = await axios.get('http://localhost:8081/run_test');
span.setStatus({ code: api.CanonicalCode.OK });
span.setStatus({ code: api.StatusCode.OK });
console.log(res.statusText);
} catch (e) {
span.setStatus({ code: api.CanonicalCode.UNKNOWN, message: e.message });
span.setStatus({ code: api.StatusCode.ERROR, message: e.message });
}
span.end();
console.log('Sleeping 5 seconds before shutdown to ensure all records are flushed.');
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.12.0",
"@opentelemetry/exporter-jaeger": "^0.12.0",
"@opentelemetry/exporter-zipkin": "^0.12.0",
"@opentelemetry/api": "^0.13.0",
"@opentelemetry/exporter-jaeger": "^0.13.0",
"@opentelemetry/exporter-zipkin": "^0.13.0",
"@opentelemetry/koa-instrumentation": "^0.11.0",
"@opentelemetry/node": "^0.12.0",
"@opentelemetry/plugin-http": "^0.12.0",
"@opentelemetry/tracing": "^0.12.0",
"@opentelemetry/node": "^0.13.0",
"@opentelemetry/plugin-http": "^0.13.0",
"@opentelemetry/tracing": "^0.13.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.12.0",
"@opentelemetry/exporter-jaeger": "^0.12.0",
"@opentelemetry/exporter-zipkin": "^0.12.0",
"@opentelemetry/node": "^0.12.0",
"@opentelemetry/plugin-http": "^0.12.0",
"@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/plugin-mysql": "^0.11.0",
"@opentelemetry/tracing": "^0.12.0",
"@opentelemetry/tracing": "^0.13.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.12.0",
"@opentelemetry/exporter-jaeger": "^0.12.0",
"@opentelemetry/exporter-zipkin": "^0.12.0",
"@opentelemetry/node": "^0.12.0",
"@opentelemetry/plugin-http": "^0.12.0",
"@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/plugin-pg": "^0.11.0",
"@opentelemetry/plugin-pg-pool": "^0.11.0",
"@opentelemetry/tracing": "^0.12.0",
"@opentelemetry/tracing": "^0.13.0",
"express": "^4.17.1",
"pg": "^7.12.1"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/postgres/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// eslint-disable-next-line import/order
const tracer = require('./tracer')('postgres-server-service');
const { SpanKind, CanonicalCode } = require('@opentelemetry/api');
const { SpanKind, StatusCode } = require('@opentelemetry/api');
const express = require('express');
const setupPg = require('./setupPsql');

Expand Down Expand Up @@ -41,7 +41,7 @@ app.get('/:cmd', (req, res) => {
});
} catch (e) {
res.status(400).send({ message: e.message });
span.setStatus(CanonicalCode.UNKNOWN);
span.setStatus(StatusCode.ERROR);
}
span.end();
});
Expand Down
10 changes: 5 additions & 5 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.10.1",
"@opentelemetry/exporter-collector": "^0.10.1",
"@opentelemetry/plugin-react-load": "^0.8.0",
"@opentelemetry/tracing": "^0.10.1",
"@opentelemetry/web": "^0.10.1",
"@opentelemetry/context-zone": "^0.13.0",
"@opentelemetry/exporter-collector": "^0.13.0",
"@opentelemetry/plugin-react-load": "^0.11.0",
"@opentelemetry/tracing": "^0.13.0",
"@opentelemetry/web": "^0.13.0",
"preact": "^10.3.2",
"preact-render-to-string": "^5.1.4",
"preact-router": "^3.2.1"
Expand Down
12 changes: 6 additions & 6 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.9.0",
"@opentelemetry/core": "^0.9.0",
"@opentelemetry/exporter-collector": "^0.10.1",
"@opentelemetry/plugin-react-load": "^0.8.0",
"@opentelemetry/tracing": "^0.9.0",
"@opentelemetry/web": "^0.9.0",
"@opentelemetry/context-zone": "^0.13.0",
"@opentelemetry/core": "^0.13.0",
"@opentelemetry/exporter-collector": "^0.13.0",
"@opentelemetry/plugin-react-load": "^0.11.0",
"@opentelemetry/tracing": "^0.13.0",
"@opentelemetry/web": "^0.13.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router-dom": "^5.2.0",
Expand Down
4 changes: 2 additions & 2 deletions examples/redis/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ function makeRequest() {
tracer.withSpan(span, async () => {
try {
const res = await axios.get('http://localhost:8080/run_test');
span.setStatus({ code: api.CanonicalCode.OK });
span.setStatus({ code: api.StatusCode.OK });
console.log(res.statusText);
} catch (e) {
span.setStatus({ code: api.CanonicalCode.UNKNOWN, message: e.message });
span.setStatus({ code: api.StatusCode.ERROR, message: e.message });
}
span.end();
console.log('Sleeping 5 seconds before shutdown to ensure all records are flushed.');
Expand Down
2 changes: 1 addition & 1 deletion examples/redis/express-tracer-handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function getErrorTracer(tracer) {
console.error('Caught error', err.message);
const span = tracer.getCurrentSpan();
if (span) {
span.setStatus({ code: api.CanonicalCode.INTERNAL, message: err.message });
span.setStatus({ code: api.StatusCode.ERROR, message: err.message });
}
res.status(500).send(err.message);
};
Expand Down
Loading

0 comments on commit 19f4319

Please sign in to comment.