@temporalio/interceptors-opentelemetry 0.15.0 → 0.16.4
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,7 +1,7 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import * as otel from '@opentelemetry/api';
|
|
2
|
-
import { AsyncLocalStorage } from '@temporalio/workflow';
|
|
3
3
|
export declare class ContextManager implements otel.ContextManager {
|
|
4
|
-
protected storage: AsyncLocalStorage<otel.Context>;
|
|
4
|
+
protected storage: import("async_hooks").AsyncLocalStorage<otel.Context>;
|
|
5
5
|
active(): otel.Context;
|
|
6
6
|
bind<T>(context: otel.Context, target: T): T;
|
|
7
7
|
enable(): this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-manager.js","sourceRoot":"","sources":["../../src/workflow/context-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA2C;AAC3C,mDAAyD;AAEzD,MAAa,cAAc;IAA3B;QACY,YAAO,GAAG,IAAI,4BAAiB,EAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"context-manager.js","sourceRoot":"","sources":["../../src/workflow/context-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA2C;AAC3C,mDAAyD;AAEzD,MAAa,cAAc;IAA3B;QACY,YAAO,GAAG,IAAI,4BAAiB,EAAgB,CAAC;IA+C5D,CAAC;IA7CC,MAAM;QACJ,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC;IACtD,CAAC;IAED,IAAI,CAAI,OAAqB,EAAE,MAAS;QACtC,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;YAChC,MAAM,IAAI,SAAS,CAAC,2CAA2C,OAAO,MAAM,EAAE,CAAC,CAAC;SACjF;QAED,8JAA8J;QAC9J,MAAM,cAAc,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE;YAC5C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QAC5D,CAAC,CAAC;QACF,MAAM,CAAC,cAAc,CAAC,cAAc,EAAE,QAAQ,EAAE;YAC9C,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE,MAAM,CAAC,MAAM;SACrB,CAAC,CAAC;QACH;;;WAGG;QACH,8DAA8D;QAC9D,OAAO,cAAqB,CAAC;IAC/B,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CACF,OAAqB,EACrB,EAAK,EACL,OAA8B,EAC9B,GAAG,IAAO;QAEV,MAAM,EAAE,GAAG,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;IAChD,CAAC;CACF;AAhDD,wCAgDC"}
|
package/lib/workflow/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './runtime';
|
|
2
2
|
import * as otel from '@opentelemetry/api';
|
|
3
|
-
import { ActivityInput, Next, StartChildWorkflowExecutionInput, WorkflowInboundCallsInterceptor, WorkflowOutboundCallsInterceptor, WorkflowExecuteInput, ContinueAsNewInput } from '@temporalio/workflow';
|
|
3
|
+
import { ActivityInput, DisposeInput, Next, StartChildWorkflowExecutionInput, WorkflowInboundCallsInterceptor, WorkflowOutboundCallsInterceptor, WorkflowExecuteInput, ContinueAsNewInput, WorkflowInternalsInterceptor } from '@temporalio/workflow';
|
|
4
4
|
export * from './definitions';
|
|
5
5
|
/**
|
|
6
6
|
* Intercepts calls to run a Workflow
|
|
@@ -23,3 +23,6 @@ export declare class OpenTelemetryOutboundInterceptor implements WorkflowOutboun
|
|
|
23
23
|
startChildWorkflowExecution(input: StartChildWorkflowExecutionInput, next: Next<WorkflowOutboundCallsInterceptor, 'startChildWorkflowExecution'>): Promise<[Promise<string>, Promise<unknown>]>;
|
|
24
24
|
continueAsNew(input: ContinueAsNewInput, next: Next<WorkflowOutboundCallsInterceptor, 'continueAsNew'>): Promise<never>;
|
|
25
25
|
}
|
|
26
|
+
export declare class OpenTelemetryInternalsInterceptor implements WorkflowInternalsInterceptor {
|
|
27
|
+
dispose(input: DisposeInput, next: Next<WorkflowInternalsInterceptor, 'dispose'>): Promise<void>;
|
|
28
|
+
}
|
package/lib/workflow/index.js
CHANGED
|
@@ -22,7 +22,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
22
22
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.OpenTelemetryOutboundInterceptor = exports.OpenTelemetryInboundInterceptor = void 0;
|
|
25
|
+
exports.OpenTelemetryInternalsInterceptor = exports.OpenTelemetryOutboundInterceptor = exports.OpenTelemetryInboundInterceptor = void 0;
|
|
26
26
|
require("./runtime"); // Patch the Workflow isolate runtime for opentelemetry
|
|
27
27
|
const workflow_1 = require("@temporalio/workflow");
|
|
28
28
|
const otel_1 = require("@temporalio/common/lib/otel");
|
|
@@ -33,11 +33,15 @@ const tracing = __importStar(require("@opentelemetry/sdk-trace-base"));
|
|
|
33
33
|
const instrumentation_1 = require("../instrumentation");
|
|
34
34
|
__exportStar(require("./definitions"), exports);
|
|
35
35
|
let tracer = undefined;
|
|
36
|
+
let contextManager = undefined;
|
|
36
37
|
function getTracer() {
|
|
38
|
+
if (contextManager === undefined) {
|
|
39
|
+
contextManager = new context_manager_1.ContextManager();
|
|
40
|
+
}
|
|
37
41
|
if (tracer === undefined) {
|
|
38
42
|
const provider = new tracing.BasicTracerProvider();
|
|
39
43
|
provider.addSpanProcessor(new tracing.SimpleSpanProcessor(new span_exporter_1.SpanExporter()));
|
|
40
|
-
provider.register({ contextManager
|
|
44
|
+
provider.register({ contextManager });
|
|
41
45
|
tracer = provider.getTracer('@temporalio/interceptor-workflow');
|
|
42
46
|
}
|
|
43
47
|
return tracer;
|
|
@@ -97,4 +101,13 @@ class OpenTelemetryOutboundInterceptor {
|
|
|
97
101
|
}
|
|
98
102
|
}
|
|
99
103
|
exports.OpenTelemetryOutboundInterceptor = OpenTelemetryOutboundInterceptor;
|
|
104
|
+
class OpenTelemetryInternalsInterceptor {
|
|
105
|
+
async dispose(input, next) {
|
|
106
|
+
if (contextManager !== undefined) {
|
|
107
|
+
contextManager.disable();
|
|
108
|
+
}
|
|
109
|
+
await next(input);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
exports.OpenTelemetryInternalsInterceptor = OpenTelemetryInternalsInterceptor;
|
|
100
113
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workflow/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAmB,CAAC,uDAAuD;AAE3E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workflow/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAmB,CAAC,uDAAuD;AAE3E,mDAW8B;AAC9B,sDAA4F;AAC5F,uDAAmD;AACnD,mDAA+C;AAC/C,+CAAyD;AACzD,uEAAyD;AACzD,wDAAgD;AAEhD,gDAA8B;AAE9B,IAAI,MAAM,GAA4B,SAAS,CAAC;AAChD,IAAI,cAAc,GA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ACD,MAAM,IAAI,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;CACF;AAPD,8EAOC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temporalio/interceptors-opentelemetry",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.4",
|
|
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.
|
|
22
|
-
"@temporalio/common": "^0.
|
|
23
|
-
"@temporalio/worker": "^0.
|
|
24
|
-
"@temporalio/workflow": "^0.
|
|
21
|
+
"@temporalio/client": "^0.16.4",
|
|
22
|
+
"@temporalio/common": "^0.16.4",
|
|
23
|
+
"@temporalio/worker": "^0.16.4",
|
|
24
|
+
"@temporalio/workflow": "^0.16.4"
|
|
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": "
|
|
36
|
+
"gitHead": "884a10970cdbc3e8d7991709e0fa3fe79fce71bd"
|
|
37
37
|
}
|