@opentelemetry/context-zone
Advanced tools
Comparing version 0.19.1-alpha.39 to 0.19.1-alpha.43
{ | ||
"name": "@opentelemetry/context-zone", | ||
"version": "0.19.1-alpha.39+23ba4bfd", | ||
"version": "0.19.1-alpha.43+d5517812", | ||
"description": "OpenTelemetry Context Zone", | ||
@@ -45,5 +45,5 @@ "main": "build/src/index.js", | ||
"devDependencies": { | ||
"@babel/core": "7.13.16", | ||
"@babel/core": "7.14.0", | ||
"@types/mocha": "8.2.2", | ||
"@types/node": "14.14.41", | ||
"@types/node": "14.14.43", | ||
"@types/sinon": "9.0.11", | ||
@@ -53,3 +53,2 @@ "@types/webpack-env": "1.16.0", | ||
"codecov": "3.8.1", | ||
"gts": "3.1.0", | ||
"karma": "5.2.3", | ||
@@ -59,3 +58,3 @@ "karma-chrome-launcher": "3.1.0", | ||
"karma-spec-reporter": "0.0.32", | ||
"karma-webpack": "5.0.0", | ||
"karma-webpack": "4.0.2", | ||
"mocha": "7.2.0", | ||
@@ -65,6 +64,6 @@ "nyc": "15.1.0", | ||
"sinon": "10.0.0", | ||
"ts-loader": "8.1.0", | ||
"ts-loader": "8.2.0", | ||
"ts-mocha": "8.0.0", | ||
"ts-node": "9.1.1", | ||
"typescript": "4.2.4", | ||
"typescript": "4.3.2", | ||
"webpack": "4.46.0", | ||
@@ -75,7 +74,7 @@ "webpack-cli": "4.6.0", | ||
"dependencies": { | ||
"@opentelemetry/context-zone-peer-dep": "^0.19.1-alpha.39+23ba4bfd", | ||
"@opentelemetry/context-zone-peer-dep": "^0.19.1-alpha.43+d5517812", | ||
"zone.js": "^0.11.0" | ||
}, | ||
"sideEffects": true, | ||
"gitHead": "23ba4bfdc77c8bf594bf0c817320a31f59ca0bd4" | ||
"gitHead": "d5517812b31d9206131bf1df4f8a3b5183ab07fb" | ||
} |
@@ -21,3 +21,3 @@ # OpenTelemetry Context Zone | ||
```js | ||
import { context, getSpan, setSpan } from '@opentelemetry/api'; | ||
import { context, trace } from '@opentelemetry/api'; | ||
import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/tracing'; | ||
@@ -37,17 +37,17 @@ import { WebTracerProvider } from '@opentelemetry/web'; | ||
context.with(setSpan(context.active(), span1), () => { | ||
console.log('Current span is span1', getSpan(context.active()) === span1); | ||
context.with(trace.setSpan(context.active(), span1), () => { | ||
console.log('Current span is span1', trace.getSpan(context.active()) === span1); | ||
setTimeout(() => { | ||
const span2 = webTracerWithZone.startSpan('foo2'); | ||
console.log('Current span is span1', getSpan(context.active()) === span1); | ||
context.with(setSpan(context.active(), span2), () => { | ||
console.log('Current span is span2', getSpan(context.active()) === span2); | ||
console.log('Current span is span1', trace.getSpan(context.active()) === span1); | ||
context.with(trace.setSpan(context.active(), span2), () => { | ||
console.log('Current span is span2', trace.getSpan(context.active()) === span2); | ||
setTimeout(() => { | ||
console.log('Current span is span2', getSpan(context.active()) === span2); | ||
console.log('Current span is span2', trace.getSpan(context.active()) === span2); | ||
}, 500); | ||
}); | ||
// there is a timeout which still keeps span2 active | ||
console.log('Current span is span2', getSpan(context.active()) === span2); | ||
console.log('Current span is span2', trace.getSpan(context.active()) === span2); | ||
}, 500); | ||
console.log('Current span is span1', getSpan(context.active()) === span1); | ||
console.log('Current span is span1', trace.getSpan(context.active()) === span1); | ||
}); | ||
@@ -54,0 +54,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
21586
23