Skip to content

Commit ac81e17

Browse files
authored
chore: upgrading to api ver. 0.20.0 (#2225)
* chore: upgrading to api ver. 0.20.0
1 parent eb9353a commit ac81e17

File tree

103 files changed

+636
-586
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+636
-586
lines changed

examples/basic-tracer-node/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ exporter.shutdown();
3737
function doWork(parent) {
3838
// Start another span. In this example, the main method already started a
3939
// span, so that'll be the parent span, and this will be a child span.
40-
const ctx = opentelemetry.setSpan(opentelemetry.context.active(), parent);
40+
const ctx = opentelemetry.trace.setSpan(opentelemetry.context.active(), parent);
4141
const span = tracer.startSpan('doWork', undefined, ctx);
4242

4343
// simulate some random work.

examples/basic-tracer-node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"url": "https://github.com/open-telemetry/opentelemetry-js/issues"
2525
},
2626
"dependencies": {
27-
"@opentelemetry/api": "^1.0.0-rc.0",
27+
"@opentelemetry/api": "^0.20.0",
2828
"@opentelemetry/exporter-jaeger": "0.19.0",
2929
"@opentelemetry/tracing": "0.19.0"
3030
},

examples/collector-exporter-node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"url": "https://github.com/open-telemetry/opentelemetry-js/issues"
2929
},
3030
"dependencies": {
31-
"@opentelemetry/api": "^1.0.0-rc.0",
31+
"@opentelemetry/api": "^0.20.0",
3232
"@opentelemetry/core": "0.19.0",
3333
"@opentelemetry/exporter-collector": "0.19.0",
3434
"@opentelemetry/exporter-collector-grpc": "0.19.0",

examples/collector-exporter-node/tracing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ setTimeout(() => {
4242
function doWork(parent) {
4343
// Start another span. In this example, the main method already started a
4444
// span, so that'll be the parent span, and this will be a child span.
45-
const ctx = opentelemetry.setSpan(opentelemetry.context.active(), parent);
45+
const ctx = opentelemetry.trace.setSpan(opentelemetry.context.active(), parent);
4646
const span = tracer.startSpan('doWork', undefined, ctx);
4747

4848
// simulate some random work.

examples/grpc-js/client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ function main() {
1515
// the span, which is created to track work that happens outside of the
1616
// request lifecycle entirely.
1717
const span = tracer.startSpan('client.js:main()');
18-
api.context.with(api.setSpan(api.context.active(), span), () => {
19-
console.log('Client traceId ', span.context().traceId);
18+
api.context.with(api.trace.setSpan(api.context.active(), span), () => {
19+
console.log('Client traceId ', span.spanContext().traceId);
2020
const client = new services.GreeterClient(
2121
`localhost:${PORT}`,
2222
grpc.credentials.createInsecure(),

examples/grpc-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"dependencies": {
3131
"@grpc/grpc-js": "^1.2.12",
32-
"@opentelemetry/api": "^1.0.0-rc.0",
32+
"@opentelemetry/api": "^0.20.0",
3333
"@opentelemetry/exporter-jaeger": "0.19.0",
3434
"@opentelemetry/exporter-zipkin": "0.19.0",
3535
"@opentelemetry/instrumentation": "0.19.0",

examples/grpc-js/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ function startServer() {
2222
}
2323

2424
function sayHello(call, callback) {
25-
const currentSpan = api.getSpan(api.context.active());
25+
const currentSpan = api.trace.getSpan(api.context.active());
2626
// display traceid in the terminal
27-
console.log(`traceid: ${currentSpan.context().traceId}`);
27+
console.log(`traceid: ${currentSpan.spanContext().traceId}`);
2828
const span = tracer.startSpan('server.js:sayHello()', {
2929
kind: 1, // server
3030
attributes: { key: 'value' },

examples/grpc/client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ function main() {
1515
// the span, which is created to track work that happens outside of the
1616
// request lifecycle entirely.
1717
const span = tracer.startSpan('client.js:main()');
18-
api.context.with(api.setSpan(api.context.active(), span), () => {
19-
console.log('Client traceId ', span.context().traceId);
18+
api.context.with(api.trace.setSpan(api.context.active(), span), () => {
19+
console.log('Client traceId ', span.spanContext().traceId);
2020
const client = new services.GreeterClient(
2121
`localhost:${PORT}`,
2222
grpc.credentials.createInsecure(),

examples/grpc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"url": "https://github.com/open-telemetry/opentelemetry-js/issues"
2929
},
3030
"dependencies": {
31-
"@opentelemetry/api": "^1.0.0-rc.0",
31+
"@opentelemetry/api": "^0.20.0",
3232
"@opentelemetry/exporter-jaeger": "0.19.0",
3333
"@opentelemetry/exporter-zipkin": "0.19.0",
3434
"@opentelemetry/instrumentation": "0.19.0",

examples/grpc/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ function startServer() {
2121
}
2222

2323
function sayHello(call, callback) {
24-
const currentSpan = api.getSpan(api.context.active());
24+
const currentSpan = api.trace.getSpan(api.context.active());
2525
// display traceid in the terminal
26-
console.log(`traceid: ${currentSpan.context().traceId}`);
26+
console.log(`traceid: ${currentSpan.spanContext().traceId}`);
2727
const span = tracer.startSpan('server.js:sayHello()', {
2828
parent: currentSpan,
2929
kind: 1, // server

0 commit comments

Comments
 (0)