Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update core to 0.20.0 #513

Merged
merged 5 commits into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"typescript": "4.2.4"
},
"dependencies": {
"@opentelemetry/api": "1.0.0-rc.3",
"@opentelemetry/resources": "^0.19.0"
"@opentelemetry/api": "0.20.0",
"@opentelemetry/resources": "^0.20.0"
}
}
4 changes: 2 additions & 2 deletions examples/dns/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function makeLookup() {
// the span, which is created to track work that happens outside of the
// dns lookup query.
const span = tracer.startSpan('dnsLookup');
api.context.with(api.setSpan(api.ROOT_CONTEXT, span), async () => {
api.context.with(api.trace.setSpan(api.ROOT_CONTEXT, span), async () => {
try {
await dns.lookup('montreal.ca');
} catch (error) {
Expand All @@ -20,7 +20,7 @@ function makeLookup() {
'error.message': error.message,
});
} finally {
console.log(`traceid: ${span.context().traceId}`);
console.log(`traceid: ${span.spanContext().traceId}`);
span.end();
}
});
Expand Down
12 changes: 6 additions & 6 deletions examples/dns/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
"url": "https://github.com/open-telemetry/opentelemetry-js-contrib/issues"
},
"dependencies": {
"@opentelemetry/api": "^1.0.0-rc.0",
"@opentelemetry/exporter-jaeger": "^0.19.0",
"@opentelemetry/exporter-zipkin": "^0.19.0",
"@opentelemetry/instrumentation": "^0.19.0",
"@opentelemetry/api": "^0.20.0",
"@opentelemetry/exporter-jaeger": "^0.20.0",
"@opentelemetry/exporter-zipkin": "^0.20.0",
"@opentelemetry/instrumentation": "^0.20.0",
"@opentelemetry/instrumentation-dns": "^0.15.0",
"@opentelemetry/node": "^0.19.0",
"@opentelemetry/tracing": "^0.19.0"
"@opentelemetry/node": "^0.20.0",
"@opentelemetry/tracing": "^0.20.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib#readme",
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/express/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function makeRequest() {
kind: api.SpanKind.CLIENT,
});

api.context.with(api.setSpan(api.ROOT_CONTEXT, span), async () => {
api.context.with(api.trace.setSpan(api.ROOT_CONTEXT, span), async () => {
try {
const res = await axios.get('http://localhost:8080/run_test');
console.log('status:', res.statusText);
Expand Down
16 changes: 8 additions & 8 deletions examples/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
"url": "https://github.com/open-telemetry/opentelemetry-js/issues"
},
"dependencies": {
"@opentelemetry/api": "^1.0.0-rc.0",
"@opentelemetry/exporter-jaeger": "^0.19.0",
"@opentelemetry/exporter-zipkin": "^0.19.0",
"@opentelemetry/instrumentation": "^0.19.0",
"@opentelemetry/api": "^0.20.0",
"@opentelemetry/exporter-jaeger": "^0.20.0",
"@opentelemetry/exporter-zipkin": "^0.20.0",
"@opentelemetry/instrumentation": "^0.20.0",
"@opentelemetry/instrumentation-express": "^0.15.0",
"@opentelemetry/instrumentation-http": "^0.19.0",
"@opentelemetry/node": "^0.19.0",
"@opentelemetry/tracing": "^0.19.0",
"axios": "^0.19.0",
"@opentelemetry/instrumentation-http": "^0.20.0",
"@opentelemetry/node": "^0.20.0",
"@opentelemetry/tracing": "^0.20.0",
"axios": "^0.20.0",
dyladan marked this conversation as resolved.
Show resolved Hide resolved
"cross-env": "^7.0.3",
"express": "^4.17.1"
},
Expand Down
10 changes: 5 additions & 5 deletions examples/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
"url": "https://github.com/open-telemetry/opentelemetry-js/issues"
},
"dependencies": {
"@opentelemetry/exporter-collector": "^0.19.0",
"@opentelemetry/instrumentation": "^0.19.0",
"@opentelemetry/exporter-collector": "^0.20.0",
"@opentelemetry/instrumentation": "^0.20.0",
"@opentelemetry/instrumentation-graphql": "^0.15.0",
"@opentelemetry/node": "^0.19.0",
"@opentelemetry/node": "^0.20.0",
"@opentelemetry/instrumentation-express": "^0.15.0",
"@opentelemetry/instrumentation-http": "^0.19.0",
"@opentelemetry/tracing": "^0.19.0",
"@opentelemetry/instrumentation-http": "^0.20.0",
"@opentelemetry/tracing": "^0.20.0",
"apollo-server": "^2.18.1",
"express": "^4.17.1",
"express-graphql": "^0.11.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc-census-prop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ that is already instrumented using OpenCensus.
If both sides of gRPC communication are using OpenTelemetry instrumentation then
the `propagator-grpc-census-binary` propagator isn't required. Context will be
propagated using the `traceparent` header (thanks to the
[HttpTraceContext](https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-core/src/context/propagation/HttpTraceContext.ts)
[HttpTraceContextPropagator](https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-core/src/trace/HttpTraceContextPropagator.ts)
propagator from opentelemetry-core). If there is a mix of OpenCensus and OpenTelemetry
instrumentation then the `propagator-grpc-census-binary` propagator allows OpenTelemetry
to propagate context through the `grpc-trace-bin` binary header.
Expand Down
4 changes: 2 additions & 2 deletions examples/grpc-census-prop/capitalize_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ function capitalizeWithCensusTracing(client, data) {
*/
function capitalizeWithOTelTracing(client, data) {
const span = tracer.startSpan('tutorialsClient.capitalize');
api.context.with(api.setSpan(api.ROOT_CONTEXT, span), () => {
api.context.with(api.trace.setSpan(api.ROOT_CONTEXT, span), () => {
client.capitalize({ data: Buffer.from(data) }, (err, response) => {
if (err) {
console.log('could not get grpc response');
return;
}
console.log('< ', response.data.toString('utf8'));
// display traceid in the terminal
console.log(`traceid: ${span.context().traceId}`);
console.log(`traceid: ${span.spanContext().traceId}`);
span.end();
});
});
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc-census-prop/capitalize_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function capitalizeWithCensusTracing(call) {
function capitalizeWithOTelTracing(call) {
const currentSpan = tracer.getCurrentSpan();
// display traceid in the terminal
console.log(`traceid: ${currentSpan.context().traceId}`);
console.log(`traceid: ${currentSpan.spanContext().traceId}`);

const span = tracer.startSpan('tutorials.FetchImpl.capitalize', {
kind: SpanKind.SERVER,
Expand Down
12 changes: 6 additions & 6 deletions examples/grpc-census-prop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
"@opencensus/instrumentation-grpc": "0.0.21",
"@opencensus/nodejs": "0.0.21",
"@opencensus/propagation-binaryformat": "0.0.21",
"@opentelemetry/api": "^1.0.0-rc.0",
"@opentelemetry/core": "^0.19.0",
"@opentelemetry/instrumentation": "^0.19.0",
"@opentelemetry/instrumentation-grpc": "^0.19.0",
"@opentelemetry/node": "^0.19.0",
"@opentelemetry/api": "^0.20.0",
"@opentelemetry/core": "^0.20.0",
"@opentelemetry/instrumentation": "^0.20.0",
"@opentelemetry/instrumentation-grpc": "^0.20.0",
"@opentelemetry/node": "^0.20.0",
"@opentelemetry/propagator-grpc-census-binary": "^0.15.0",
"@opentelemetry/tracing": "^0.19.0",
"@opentelemetry/tracing": "^0.20.0",
"grpc": "^1.24.2"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme",
Expand Down
4 changes: 2 additions & 2 deletions examples/grpc-census-prop/tracer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const opentelemetry = require('@opentelemetry/api');
const { NodeTracerProvider } = require('@opentelemetry/node');
const { SimpleSpanProcessor, ConsoleSpanExporter } = require('@opentelemetry/tracing');
const { HttpTraceContext } = require('@opentelemetry/core');
const { HttpTraceContextPropagator } = require('@opentelemetry/core');
const { GrpcCensusPropagator } = require('@opentelemetry/propagator-grpc-census-binary');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { GrpcInstrumentation } = require('@opentelemetry/instrumentation-grpc');
Expand All @@ -26,7 +26,7 @@ module.exports = (serviceName, binaryPropagator) => {
});
} else {
provider.register({
propagator: new HttpTraceContext(),
propagator: new HttpTraceContextPropagator(),
});
}

Expand Down
4 changes: 2 additions & 2 deletions examples/grpc_dynamic_codegen/capitalize_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ function main() {
console.log('> ', data);

const span = tracer.startSpan('tutorialsClient.capitalize');
api.context.with(api.setSpan(api.ROOT_CONTEXT, span), () => {
api.context.with(api.trace.setSpan(api.ROOT_CONTEXT, span), () => {
client.capitalize({ data: Buffer.from(data) }, (err, response) => {
if (err) {
console.log('could not get grpc response');
return;
}
console.log('< ', response.data.toString('utf8'));
// display traceid in the terminal
console.log(`traceid: ${span.context().traceId}`);
console.log(`traceid: ${span.spanContext().traceId}`);
span.end();
});
});
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc_dynamic_codegen/capitalize_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const rpcProto = grpc.loadPackageDefinition(definition).rpc;
function capitalize(call, callback) {
const currentSpan = tracer.getCurrentSpan();
// display traceid in the terminal
console.log(`traceid: ${currentSpan.context().traceId}`);
console.log(`traceid: ${currentSpan.spanContext().traceId}`);

const span = tracer.startSpan('tutorials.FetchImpl.capitalize', {
kind: SpanKind.SERVER,
Expand Down
12 changes: 6 additions & 6 deletions examples/grpc_dynamic_codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
},
"dependencies": {
"@grpc/proto-loader": "^0.4.0",
"@opentelemetry/api": "^1.0.0-rc.0",
"@opentelemetry/exporter-jaeger": "^0.19.0",
"@opentelemetry/exporter-zipkin": "^0.19.0",
"@opentelemetry/node": "^0.19.0",
"@opentelemetry/instrumentation-grpc": "^0.19.0",
"@opentelemetry/tracing": "^0.19.0",
"@opentelemetry/api": "^0.20.0",
"@opentelemetry/exporter-jaeger": "^0.20.0",
"@opentelemetry/exporter-zipkin": "^0.20.0",
"@opentelemetry/node": "^0.20.0",
"@opentelemetry/instrumentation-grpc": "^0.20.0",
"@opentelemetry/tracing": "^0.20.0",
"grpc": "^1.24.6"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme",
Expand Down
2 changes: 1 addition & 1 deletion examples/hapi/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function makeRequest() {
kind: api.SpanKind.CLIENT,
});

api.context.with(api.setSpan(api.ROOT_CONTEXT, span), async () => {
api.context.with(api.trace.setSpan(api.ROOT_CONTEXT, span), async () => {
try {
const res = await axios.get('http://localhost:8081/run_test');
span.setStatus({ code: api.StatusCode.OK });
Expand Down
16 changes: 8 additions & 8 deletions examples/hapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
},
"dependencies": {
"@hapi/hapi": "^19.2.0",
"@opentelemetry/api": "^1.0.0-rc.0",
"@opentelemetry/exporter-jaeger": "^0.19.0",
"@opentelemetry/exporter-zipkin": "^0.19.0",
"@opentelemetry/instrumentation": "^0.19.0",
"@opentelemetry/api": "^0.20.0",
"@opentelemetry/exporter-jaeger": "^0.20.0",
"@opentelemetry/exporter-zipkin": "^0.20.0",
"@opentelemetry/instrumentation": "^0.20.0",
"@opentelemetry/instrumentation-hapi": "^0.15.0",
"@opentelemetry/instrumentation-http": "^0.19.0",
"@opentelemetry/node": "^0.19.0",
"@opentelemetry/tracing": "^0.19.0",
"axios": "^0.19.0"
"@opentelemetry/instrumentation-http": "^0.20.0",
"@opentelemetry/node": "^0.20.0",
"@opentelemetry/tracing": "^0.20.0",
"axios": "^0.20.0"
dyladan marked this conversation as resolved.
Show resolved Hide resolved
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib#readme",
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions examples/hapi/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const posts = ['post 0', 'post 1', 'post 2'];

function addPost(_, h) {
posts.push(`post ${posts.length}`);
const currentSpan = api.getSpan(api.context.active());
const currentSpan = api.trace.getSpan(api.context.active());
currentSpan.addEvent('Added post');
currentSpan.setAttribute('Date', new Date());
console.log(`Added post: ${posts[posts.length - 1]}`);
Expand All @@ -82,8 +82,8 @@ async function showNewPost(request) {
}

function runTest(_, h) {
const currentSpan = api.getSpan(api.context.active());
const { traceId } = currentSpan.context();
const currentSpan = api.trace.getSpan(api.context.active());
const { traceId } = currentSpan.spanContext();
console.log(`traceid: ${traceId}`);
console.log(`Jaeger URL: http://localhost:16686/trace/${traceId}`);
console.log(`Zipkin URL: http://localhost:9411/zipkin/traces/${traceId}`);
Expand Down
12 changes: 6 additions & 6 deletions examples/host-metrics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
"url": "https://github.com/open-telemetry/opentelemetry-js/issues"
},
"dependencies": {
"@opentelemetry/api": "^1.0.0-rc.0",
"@opentelemetry/core": "^0.19.0",
"@opentelemetry/exporter-collector": "^0.19.0",
"@opentelemetry/exporter-prometheus": "^0.19.0",
"@opentelemetry/api": "^0.20.0",
"@opentelemetry/core": "^0.20.0",
"@opentelemetry/exporter-collector": "^0.20.0",
"@opentelemetry/exporter-prometheus": "^0.20.0",
"@opentelemetry/host-metrics": "^0.15.0",
"@opentelemetry/instrumentation": "^0.19.0",
"@opentelemetry/metrics": "^0.19.0"
"@opentelemetry/instrumentation": "^0.20.0",
"@opentelemetry/metrics": "^0.20.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme"
}
10 changes: 5 additions & 5 deletions examples/ioredis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
"url": "https://github.com/open-telemetry/opentelemetry-js-contrib/issues"
},
"dependencies": {
"@opentelemetry/api": "^1.0.0-rc.0",
"@opentelemetry/exporter-jaeger": "^0.19.0",
"@opentelemetry/instrumentation": "^0.19.0",
"@opentelemetry/api": "^0.20.0",
"@opentelemetry/exporter-jaeger": "^0.20.0",
"@opentelemetry/instrumentation": "^0.20.0",
"@opentelemetry/instrumentation-ioredis": "^0.15.0",
"@opentelemetry/node": "^0.19.0",
"@opentelemetry/tracing": "^0.19.0",
"@opentelemetry/node": "^0.20.0",
"@opentelemetry/tracing": "^0.20.0",
"ioredis": "^4.22.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib#readme"
Expand Down
2 changes: 1 addition & 1 deletion examples/koa/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function makeRequest() {
kind: api.SpanKind.CLIENT,
});

api.context.with(api.setSpan(api.ROOT_CONTEXT, span), async () => {
api.context.with(api.trace.setSpan(api.ROOT_CONTEXT, span), async () => {
try {
const res = await axios.get('http://localhost:8081/run_test');
span.setStatus({ code: api.StatusCode.OK });
Expand Down
16 changes: 8 additions & 8 deletions examples/koa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
},
"dependencies": {
"@koa/router": "^9.3.1",
"@opentelemetry/api": "^1.0.0-rc.0",
"@opentelemetry/exporter-jaeger": "^0.19.0",
"@opentelemetry/exporter-zipkin": "^0.19.0",
"@opentelemetry/instrumentation": "^0.19.0",
"@opentelemetry/instrumentation-http": "^0.19.0",
"@opentelemetry/api": "^0.20.0",
"@opentelemetry/exporter-jaeger": "^0.20.0",
"@opentelemetry/exporter-zipkin": "^0.20.0",
"@opentelemetry/instrumentation": "^0.20.0",
"@opentelemetry/instrumentation-http": "^0.20.0",
"@opentelemetry/instrumentation-koa": "^0.15.0",
"@opentelemetry/node": "^0.19.0",
"@opentelemetry/tracing": "^0.19.0",
"axios": "^0.19.0",
"@opentelemetry/node": "^0.20.0",
"@opentelemetry/tracing": "^0.20.0",
"axios": "^0.20.0",
dyladan marked this conversation as resolved.
Show resolved Hide resolved
"koa": "^2.13.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib#readme",
Expand Down
6 changes: 3 additions & 3 deletions examples/koa/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const posts = ['post 0', 'post 1', 'post 2'];

function addPost(ctx) {
posts.push(`post ${posts.length}`);
const currentSpan = api.getSpan(api.context.active());
const currentSpan = api.trace.getSpan(api.context.active());
currentSpan.addEvent('Added post');
currentSpan.setAttribute('Date', new Date());
ctx.body = `Added post: ${posts[posts.length - 1]}`;
Expand All @@ -48,8 +48,8 @@ async function showNewPost(ctx) {

function runTest(ctx) {
console.log('runTest');
const currentSpan = api.getSpan(api.context.active());
const { traceId } = currentSpan.context();
const currentSpan = api.trace.getSpan(api.context.active());
const { traceId } = currentSpan.spanContext();
console.log(`traceid: ${traceId}`);
console.log(`Jaeger URL: http://localhost:16686/trace/${traceId}`);
console.log(`Zipkin URL: http://localhost:9411/zipkin/traces/${traceId}`);
Expand Down
2 changes: 1 addition & 1 deletion examples/meta-node/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function makeRequest() {
kind: api.SpanKind.CLIENT,
});

api.context.with(api.setSpan(api.ROOT_CONTEXT, span), async () => {
api.context.with(api.trace.setSpan(api.ROOT_CONTEXT, span), async () => {
try {
const res = await axios.get('http://localhost:8080/run_test');
span.setStatus({ code: api.SpanStatusCode.OK });
Expand Down
10 changes: 5 additions & 5 deletions examples/meta-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
"eslint": "^7.4.0"
},
"dependencies": {
"@opentelemetry/api": "^1.0.0-rc.0",
"@opentelemetry/api": "^0.20.0",
"@opentelemetry/auto-instrumentations-node": "^0.15.0",
"@opentelemetry/exporter-collector": "^0.19.0",
"@opentelemetry/instrumentation": "^0.19.0",
"@opentelemetry/node": "^0.19.0",
"@opentelemetry/tracing": "^0.19.0",
"@opentelemetry/exporter-collector": "^0.20.0",
"@opentelemetry/instrumentation": "^0.20.0",
"@opentelemetry/node": "^0.20.0",
"@opentelemetry/tracing": "^0.20.0",
"axios": "^0.21.1",
"express": "^4.17.1"
}
Expand Down
Loading