Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opentelemetry/context-zone

Package Overview
Dependencies
Maintainers
4
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/context-zone - npm Package Compare versions

Comparing version 0.19.1-alpha.39 to 0.19.1-alpha.43

17

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc