@temporalio/interceptors-opentelemetry 0.21.1 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1 @@
1
- /**
2
- * Sets global variables required for importing opentelemetry in isolate
3
- * @module
4
- */
1
+ export {};
@@ -1,14 +1,20 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  /**
3
4
  * Sets global variables required for importing opentelemetry in isolate
4
5
  * @module
5
6
  */
6
- // Required by opentelemetry (pretend to be a browser)
7
- globalThis.performance = {
8
- timeOrigin: Date.now(),
9
- now() {
10
- return Date.now() - this.timeOrigin;
11
- },
12
- };
13
- globalThis.window = globalThis;
7
+ const workflow_1 = require("@temporalio/workflow");
8
+ if ((0, workflow_1.inWorkflowContext)()) {
9
+ // Required by opentelemetry (pretend to be a browser)
10
+ Object.assign(globalThis, {
11
+ performance: {
12
+ timeOrigin: Date.now(),
13
+ now() {
14
+ return Date.now() - this.timeOrigin;
15
+ },
16
+ },
17
+ window: globalThis,
18
+ });
19
+ }
14
20
  //# sourceMappingURL=runtime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/workflow/runtime.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,sDAAsD;AACrD,UAAkB,CAAC,WAAW,GAAG;IAChC,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE;IACtB,GAAG;QACD,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC;IACtC,CAAC;CACF,CAAC;AACD,UAAkB,CAAC,MAAM,GAAG,UAAU,CAAC"}
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/workflow/runtime.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,mDAAyD;AAEzD,IAAI,IAAA,4BAAiB,GAAE,EAAE;IACvB,sDAAsD;IACtD,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE;QACxB,WAAW,EAAE;YACX,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE;YACtB,GAAG;gBACD,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC;YACtC,CAAC;SACF;QACD,MAAM,EAAE,UAAU;KACnB,CAAC,CAAC;CACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@temporalio/interceptors-opentelemetry",
3
- "version": "0.21.1",
3
+ "version": "0.22.0",
4
4
  "description": "Temporal.io SDK interceptors bundle for tracing with opentelemetry",
5
5
  "main": "lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -18,10 +18,10 @@
18
18
  "@opentelemetry/core": "^1.0.0",
19
19
  "@opentelemetry/resources": "^1.0.0",
20
20
  "@opentelemetry/sdk-trace-base": "^1.0.0",
21
- "@temporalio/client": "^0.21.0",
22
- "@temporalio/common": "^0.21.0",
23
- "@temporalio/worker": "^0.21.1",
24
- "@temporalio/workflow": "^0.21.0"
21
+ "@temporalio/client": "^0.22.0",
22
+ "@temporalio/common": "^0.22.0",
23
+ "@temporalio/worker": "^0.22.0",
24
+ "@temporalio/workflow": "^0.22.0"
25
25
  },
26
26
  "bugs": {
27
27
  "url": "https://github.com/temporalio/sdk-typescript/issues"
@@ -33,5 +33,5 @@
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
- "gitHead": "c241ab2f8e92966555dbd6d01dc072c8965ee6f4"
36
+ "gitHead": "3aa1f14982bd170d21b728cbf016dc4f1b595a76"
37
37
  }