@temporalio/interceptors-opentelemetry 1.13.2 → 1.14.1

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.
Files changed (45) hide show
  1. package/{LICENSE.md → LICENSE} +6 -8
  2. package/lib/client/index.d.ts +9 -1
  3. package/lib/client/index.js +125 -6
  4. package/lib/client/index.js.map +1 -1
  5. package/lib/instrumentation.d.ts +18 -0
  6. package/lib/instrumentation.js +50 -10
  7. package/lib/instrumentation.js.map +1 -1
  8. package/lib/worker/index.d.ts +5 -4
  9. package/lib/worker/index.js +30 -5
  10. package/lib/worker/index.js.map +1 -1
  11. package/lib/workflow/context-manager.d.ts +2 -2
  12. package/lib/workflow/context-manager.js +2 -8
  13. package/lib/workflow/context-manager.js.map +1 -1
  14. package/lib/workflow/definitions.d.ts +46 -2
  15. package/lib/workflow/definitions.js +44 -0
  16. package/lib/workflow/definitions.js.map +1 -1
  17. package/lib/workflow/index.d.ts +6 -3
  18. package/lib/workflow/index.js +82 -22
  19. package/lib/workflow/index.js.map +1 -1
  20. package/lib/workflow/runtime.js +2 -3
  21. package/lib/workflow/runtime.js.map +1 -1
  22. package/lib/workflow/span-exporter.d.ts +1 -1
  23. package/lib/workflow/span-exporter.js +6 -6
  24. package/lib/workflow/span-exporter.js.map +1 -1
  25. package/lib/workflow/workflow-imports-impl.d.ts +9 -0
  26. package/lib/workflow/workflow-imports-impl.js +20 -0
  27. package/lib/workflow/workflow-imports-impl.js.map +1 -0
  28. package/lib/workflow/workflow-imports.d.ts +19 -0
  29. package/lib/workflow/workflow-imports.js +26 -0
  30. package/lib/workflow/workflow-imports.js.map +1 -0
  31. package/package.json +13 -13
  32. package/src/client/index.ts +179 -6
  33. package/src/instrumentation.ts +54 -8
  34. package/src/worker/index.ts +45 -5
  35. package/src/workflow/context-manager.ts +6 -13
  36. package/src/workflow/definitions.ts +55 -1
  37. package/src/workflow/index.ts +112 -23
  38. package/src/workflow/runtime.ts +2 -4
  39. package/src/workflow/span-exporter.ts +6 -7
  40. package/src/workflow/workflow-imports-impl.ts +9 -0
  41. package/src/workflow/workflow-imports.ts +42 -0
  42. package/lib/workflow/workflow-module-loader.d.ts +0 -28
  43. package/lib/workflow/workflow-module-loader.js +0 -56
  44. package/lib/workflow/workflow-module-loader.js.map +0 -1
  45. package/src/workflow/workflow-module-loader.ts +0 -64
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/workflow/definitions.ts"],"names":[],"mappings":";;;AAwCA,IAAY,QAoCX;AApCD,WAAY,QAAQ;IAClB;;OAEG;IACH,4CAAgC,CAAA;IAEhC;;OAEG;IACH,8CAAkC,CAAA;IAElC;;OAEG;IACH,kEAAsD,CAAA;IAEtD;;OAEG;IACH,4CAAgC,CAAA;IAChC;;OAEG;IACH,uDAA2C,CAAA;IAC3C;;OAEG;IACH,4CAAgC,CAAA;IAChC;;OAEG;IACH,4CAAgC,CAAA;IAChC;;OAEG;IACH,6CAAiC,CAAA;AACnC,CAAC,EApCW,QAAQ,wBAAR,QAAQ,QAoCnB;AAEY,QAAA,cAAc,GAAG,GAAG,CAAC"}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/workflow/definitions.ts"],"names":[],"mappings":";;;AAwCA,IAAY,QA0FX;AA1FD,WAAY,QAAQ;IAClB;;OAEG;IACH,4CAAgC,CAAA;IAEhC;;OAEG;IACH,8CAAkC,CAAA;IAElC;;OAEG;IACH,kEAAsD,CAAA;IAEtD;;OAEG;IACH,4CAAgC,CAAA;IAEhC;;OAEG;IACH,yDAA6C,CAAA;IAE7C;;OAEG;IACH,kEAAsD,CAAA;IAEtD;;OAEG;IACH,mDAAuC,CAAA;IAEvC;;OAEG;IACH,iDAAqC,CAAA;IAErC;;OAEG;IACH,mDAAuC,CAAA;IAEvC;;OAEG;IACH,uDAA2C,CAAA;IAE3C;;OAEG;IACH,oDAAwC,CAAA;IAExC;;OAEG;IACH,8CAAkC,CAAA;IAElC;;OAEG;IACH,kDAAsC,CAAA;IAEtC;;OAEG;IACH,4CAAgC,CAAA;IAChC;;OAEG;IACH,uDAA2C,CAAA;IAC3C;;OAEG;IACH,4CAAgC,CAAA;IAChC;;OAEG;IACH,4CAAgC,CAAA;IAChC;;OAEG;IACH,6CAAiC,CAAA;IACjC;;OAEG;IACH,yDAA6C,CAAA;AAC/C,CAAC,EA1FW,QAAQ,wBAAR,QAAQ,QA0FnB;AAEY,QAAA,cAAc,GAAG,GAAG,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import './runtime';
2
2
  import * as otel from '@opentelemetry/api';
3
- import type { ActivityInput, ContinueAsNewInput, DisposeInput, GetLogAttributesInput, LocalActivityInput, Next, SignalInput, SignalWorkflowInput, StartChildWorkflowExecutionInput, WorkflowExecuteInput, WorkflowInboundCallsInterceptor, WorkflowInternalsInterceptor, WorkflowOutboundCallsInterceptor } from '@temporalio/workflow';
3
+ import type { ActivityInput, ContinueAsNewInput, DisposeInput, GetLogAttributesInput, GetMetricTagsInput, LocalActivityInput, Next, QueryInput, SignalInput, SignalWorkflowInput, StartChildWorkflowExecutionInput, UpdateInput, WorkflowExecuteInput, WorkflowInboundCallsInterceptor, WorkflowInternalsInterceptor, WorkflowOutboundCallsInterceptor, StartNexusOperationInput, StartNexusOperationOutput } from '@temporalio/workflow';
4
4
  export * from './definitions';
5
5
  /**
6
6
  * Intercepts calls to run a Workflow
@@ -12,9 +12,11 @@ export * from './definitions';
12
12
  */
13
13
  export declare class OpenTelemetryInboundInterceptor implements WorkflowInboundCallsInterceptor {
14
14
  protected readonly tracer: otel.Tracer;
15
- constructor();
16
15
  execute(input: WorkflowExecuteInput, next: Next<WorkflowInboundCallsInterceptor, 'execute'>): Promise<unknown>;
17
16
  handleSignal(input: SignalInput, next: Next<WorkflowInboundCallsInterceptor, 'handleSignal'>): Promise<void>;
17
+ handleUpdate(input: UpdateInput, next: Next<WorkflowInboundCallsInterceptor, 'handleUpdate'>): Promise<unknown>;
18
+ validateUpdate(input: UpdateInput, next: Next<WorkflowInboundCallsInterceptor, 'validateUpdate'>): void;
19
+ handleQuery(input: QueryInput, next: Next<WorkflowInboundCallsInterceptor, 'handleQuery'>): Promise<unknown>;
18
20
  }
19
21
  /**
20
22
  * Intercepts outbound calls to schedule an Activity
@@ -25,13 +27,14 @@ export declare class OpenTelemetryInboundInterceptor implements WorkflowInboundC
25
27
  */
26
28
  export declare class OpenTelemetryOutboundInterceptor implements WorkflowOutboundCallsInterceptor {
27
29
  protected readonly tracer: otel.Tracer;
28
- constructor();
29
30
  scheduleActivity(input: ActivityInput, next: Next<WorkflowOutboundCallsInterceptor, 'scheduleActivity'>): Promise<unknown>;
30
31
  scheduleLocalActivity(input: LocalActivityInput, next: Next<WorkflowOutboundCallsInterceptor, 'scheduleLocalActivity'>): Promise<unknown>;
32
+ startNexusOperation(input: StartNexusOperationInput, next: Next<WorkflowOutboundCallsInterceptor, 'startNexusOperation'>): Promise<StartNexusOperationOutput>;
31
33
  startChildWorkflowExecution(input: StartChildWorkflowExecutionInput, next: Next<WorkflowOutboundCallsInterceptor, 'startChildWorkflowExecution'>): Promise<[Promise<string>, Promise<unknown>]>;
32
34
  continueAsNew(input: ContinueAsNewInput, next: Next<WorkflowOutboundCallsInterceptor, 'continueAsNew'>): Promise<never>;
33
35
  signalWorkflow(input: SignalWorkflowInput, next: Next<WorkflowOutboundCallsInterceptor, 'signalWorkflow'>): Promise<void>;
34
36
  getLogAttributes(input: GetLogAttributesInput, next: Next<WorkflowOutboundCallsInterceptor, 'getLogAttributes'>): Record<string, unknown>;
37
+ getMetricTags(input: GetMetricTagsInput, next: Next<WorkflowOutboundCallsInterceptor, 'getMetricTags'>): GetMetricTagsInput;
35
38
  }
36
39
  export declare class OpenTelemetryInternalsInterceptor implements WorkflowInternalsInterceptor {
37
40
  dispose(input: DisposeInput, next: Next<WorkflowInternalsInterceptor, 'dispose'>): Promise<void>;
@@ -36,7 +36,7 @@ const instrumentation_1 = require("../instrumentation");
36
36
  const context_manager_1 = require("./context-manager");
37
37
  const definitions_1 = require("./definitions");
38
38
  const span_exporter_1 = require("./span-exporter");
39
- const workflow_module_loader_1 = require("./workflow-module-loader");
39
+ const workflow_imports_1 = require("./workflow-imports");
40
40
  __exportStar(require("./definitions"), exports);
41
41
  let tracer = undefined;
42
42
  let contextManager = undefined;
@@ -62,32 +62,67 @@ function getTracer() {
62
62
  */
63
63
  class OpenTelemetryInboundInterceptor {
64
64
  tracer = getTracer();
65
- constructor() {
66
- (0, workflow_module_loader_1.ensureWorkflowModuleLoaded)();
67
- }
68
65
  async execute(input, next) {
69
- const { workflowInfo, ContinueAsNew } = (0, workflow_module_loader_1.getWorkflowModule)();
70
66
  const context = (0, instrumentation_1.extractContextFromHeaders)(input.headers);
71
- if (!(0, workflow_module_loader_1.hasSdkFlag)('OpenTelemetryInterceporsAvoidsExtraYields'))
67
+ if (!(0, workflow_imports_1.getActivator)().hasFlag(workflow_imports_1.SdkFlags.OpenTelemetryInterceporsAvoidsExtraYields))
72
68
  await Promise.resolve();
73
69
  return await (0, instrumentation_1.instrument)({
74
70
  tracer: this.tracer,
75
- spanName: `${definitions_1.SpanName.WORKFLOW_EXECUTE}${definitions_1.SPAN_DELIMITER}${workflowInfo().workflowType}`,
71
+ spanName: `${definitions_1.SpanName.WORKFLOW_EXECUTE}${definitions_1.SPAN_DELIMITER}${(0, workflow_imports_1.workflowInfo)().workflowType}`,
76
72
  fn: () => next(input),
77
73
  context,
78
- acceptableErrors: (err) => err instanceof ContinueAsNew,
74
+ acceptableErrors: (err) => err instanceof workflow_imports_1.ContinueAsNew,
79
75
  });
80
76
  }
81
77
  async handleSignal(input, next) {
82
78
  // Tracing of inbound signals was added in v1.11.5.
83
- if (!(0, workflow_module_loader_1.hasSdkFlag)('OpenTelemetryInterceptorsTracesInboundSignals'))
79
+ if (!(0, workflow_imports_1.getActivator)().hasFlag(workflow_imports_1.SdkFlags.OpenTelemetryInterceptorsTracesInboundSignals))
84
80
  return next(input);
85
81
  const context = (0, instrumentation_1.extractContextFromHeaders)(input.headers);
86
- if (!(0, workflow_module_loader_1.hasSdkFlag)('OpenTelemetryInterceporsAvoidsExtraYields'))
82
+ if (!(0, workflow_imports_1.getActivator)().hasFlag(workflow_imports_1.SdkFlags.OpenTelemetryInterceporsAvoidsExtraYields))
87
83
  await Promise.resolve();
88
84
  return await (0, instrumentation_1.instrument)({
89
85
  tracer: this.tracer,
90
- spanName: `${definitions_1.SpanName.WORKFLOW_SIGNAL}${definitions_1.SPAN_DELIMITER}${input.signalName}`,
86
+ spanName: `${definitions_1.SpanName.WORKFLOW_HANDLE_SIGNAL}${definitions_1.SPAN_DELIMITER}${input.signalName}`,
87
+ fn: () => next(input),
88
+ context,
89
+ });
90
+ }
91
+ async handleUpdate(input, next) {
92
+ if (!(0, workflow_imports_1.getActivator)().hasFlag(workflow_imports_1.SdkFlags.OpenTelemetryInterceptorsInstrumentsAllMethods))
93
+ return next(input);
94
+ const context = (0, instrumentation_1.extractContextFromHeaders)(input.headers);
95
+ return await (0, instrumentation_1.instrument)({
96
+ tracer: this.tracer,
97
+ spanName: `${definitions_1.SpanName.WORKFLOW_HANDLE_UPDATE}${definitions_1.SPAN_DELIMITER}${input.name}`,
98
+ fn: (span) => {
99
+ span.setAttribute(instrumentation_1.UPDATE_ID_ATTR_KEY, input.updateId);
100
+ return next(input);
101
+ },
102
+ context,
103
+ });
104
+ }
105
+ validateUpdate(input, next) {
106
+ if (!(0, workflow_imports_1.getActivator)().hasFlag(workflow_imports_1.SdkFlags.OpenTelemetryInterceptorsInstrumentsAllMethods))
107
+ return next(input);
108
+ const context = (0, instrumentation_1.extractContextFromHeaders)(input.headers);
109
+ (0, instrumentation_1.instrumentSync)({
110
+ tracer: this.tracer,
111
+ spanName: `${definitions_1.SpanName.WORKFLOW_VALIDATE_UPDATE}${definitions_1.SPAN_DELIMITER}${input.name}`,
112
+ fn: (span) => {
113
+ span.setAttribute(instrumentation_1.UPDATE_ID_ATTR_KEY, input.updateId);
114
+ return next(input);
115
+ },
116
+ context,
117
+ });
118
+ }
119
+ async handleQuery(input, next) {
120
+ if (!(0, workflow_imports_1.getActivator)().hasFlag(workflow_imports_1.SdkFlags.OpenTelemetryInterceptorsInstrumentsAllMethods))
121
+ return next(input);
122
+ const context = (0, instrumentation_1.extractContextFromHeaders)(input.headers);
123
+ return await (0, instrumentation_1.instrument)({
124
+ tracer: this.tracer,
125
+ spanName: `${definitions_1.SpanName.WORKFLOW_HANDLE_QUERY}${definitions_1.SPAN_DELIMITER}${input.queryName}`,
91
126
  fn: () => next(input),
92
127
  context,
93
128
  });
@@ -103,16 +138,13 @@ exports.OpenTelemetryInboundInterceptor = OpenTelemetryInboundInterceptor;
103
138
  */
104
139
  class OpenTelemetryOutboundInterceptor {
105
140
  tracer = getTracer();
106
- constructor() {
107
- (0, workflow_module_loader_1.ensureWorkflowModuleLoaded)();
108
- }
109
141
  async scheduleActivity(input, next) {
110
142
  return await (0, instrumentation_1.instrument)({
111
143
  tracer: this.tracer,
112
144
  spanName: `${definitions_1.SpanName.ACTIVITY_START}${definitions_1.SPAN_DELIMITER}${input.activityType}`,
113
145
  fn: async () => {
114
146
  const headers = (0, instrumentation_1.headersWithContext)(input.headers);
115
- if (!(0, workflow_module_loader_1.hasSdkFlag)('OpenTelemetryInterceporsAvoidsExtraYields'))
147
+ if (!(0, workflow_imports_1.getActivator)().hasFlag(workflow_imports_1.SdkFlags.OpenTelemetryInterceporsAvoidsExtraYields))
116
148
  await Promise.resolve();
117
149
  return next({
118
150
  ...input,
@@ -123,14 +155,14 @@ class OpenTelemetryOutboundInterceptor {
123
155
  }
124
156
  async scheduleLocalActivity(input, next) {
125
157
  // Tracing of local activities was added in v1.11.6.
126
- if (!(0, workflow_module_loader_1.hasSdkFlag)('OpenTelemetryInterceptorsTracesLocalActivities'))
158
+ if (!(0, workflow_imports_1.getActivator)().hasFlag(workflow_imports_1.SdkFlags.OpenTelemetryInterceptorsTracesLocalActivities))
127
159
  return next(input);
128
160
  return await (0, instrumentation_1.instrument)({
129
161
  tracer: this.tracer,
130
162
  spanName: `${definitions_1.SpanName.ACTIVITY_START}${definitions_1.SPAN_DELIMITER}${input.activityType}`,
131
163
  fn: async () => {
132
164
  const headers = (0, instrumentation_1.headersWithContext)(input.headers);
133
- if (!(0, workflow_module_loader_1.hasSdkFlag)('OpenTelemetryInterceporsAvoidsExtraYields'))
165
+ if (!(0, workflow_imports_1.getActivator)().hasFlag(workflow_imports_1.SdkFlags.OpenTelemetryInterceporsAvoidsExtraYields))
134
166
  await Promise.resolve();
135
167
  return next({
136
168
  ...input,
@@ -139,13 +171,27 @@ class OpenTelemetryOutboundInterceptor {
139
171
  },
140
172
  });
141
173
  }
174
+ async startNexusOperation(input, next) {
175
+ if (!(0, workflow_imports_1.getActivator)().hasFlag(workflow_imports_1.SdkFlags.OpenTelemetryInterceptorsInstrumentsAllMethods))
176
+ return next(input);
177
+ return await (0, instrumentation_1.instrument)({
178
+ tracer: this.tracer,
179
+ spanName: `${definitions_1.SpanName.NEXUS_OPERATION_START}${definitions_1.SPAN_DELIMITER}${input.service}${definitions_1.SPAN_DELIMITER}${input.operation}`,
180
+ fn: async (span) => {
181
+ span.setAttribute(instrumentation_1.NEXUS_SERVICE_ATTR_KEY, input.service);
182
+ span.setAttribute(instrumentation_1.NEXUS_OPERATION_ATTR_KEY, input.operation);
183
+ span.setAttribute(instrumentation_1.NEXUS_ENDPOINT_ATTR_KEY, input.endpoint);
184
+ return await next(input);
185
+ },
186
+ });
187
+ }
142
188
  async startChildWorkflowExecution(input, next) {
143
189
  return await (0, instrumentation_1.instrument)({
144
190
  tracer: this.tracer,
145
191
  spanName: `${definitions_1.SpanName.CHILD_WORKFLOW_START}${definitions_1.SPAN_DELIMITER}${input.workflowType}`,
146
192
  fn: async () => {
147
193
  const headers = (0, instrumentation_1.headersWithContext)(input.headers);
148
- if (!(0, workflow_module_loader_1.hasSdkFlag)('OpenTelemetryInterceporsAvoidsExtraYields'))
194
+ if (!(0, workflow_imports_1.getActivator)().hasFlag(workflow_imports_1.SdkFlags.OpenTelemetryInterceporsAvoidsExtraYields))
149
195
  await Promise.resolve();
150
196
  return next({
151
197
  ...input,
@@ -155,20 +201,19 @@ class OpenTelemetryOutboundInterceptor {
155
201
  });
156
202
  }
157
203
  async continueAsNew(input, next) {
158
- const { ContinueAsNew } = (0, workflow_module_loader_1.getWorkflowModule)();
159
204
  return await (0, instrumentation_1.instrument)({
160
205
  tracer: this.tracer,
161
206
  spanName: `${definitions_1.SpanName.CONTINUE_AS_NEW}${definitions_1.SPAN_DELIMITER}${input.options.workflowType}`,
162
207
  fn: async () => {
163
208
  const headers = (0, instrumentation_1.headersWithContext)(input.headers);
164
- if (!(0, workflow_module_loader_1.hasSdkFlag)('OpenTelemetryInterceporsAvoidsExtraYields'))
209
+ if (!(0, workflow_imports_1.getActivator)().hasFlag(workflow_imports_1.SdkFlags.OpenTelemetryInterceporsAvoidsExtraYields))
165
210
  await Promise.resolve();
166
211
  return next({
167
212
  ...input,
168
213
  headers,
169
214
  });
170
215
  },
171
- acceptableErrors: (err) => err instanceof ContinueAsNew,
216
+ acceptableErrors: (err) => err instanceof workflow_imports_1.ContinueAsNew,
172
217
  });
173
218
  }
174
219
  async signalWorkflow(input, next) {
@@ -177,7 +222,7 @@ class OpenTelemetryOutboundInterceptor {
177
222
  spanName: `${definitions_1.SpanName.WORKFLOW_SIGNAL}${definitions_1.SPAN_DELIMITER}${input.signalName}`,
178
223
  fn: async () => {
179
224
  const headers = (0, instrumentation_1.headersWithContext)(input.headers);
180
- if (!(0, workflow_module_loader_1.hasSdkFlag)('OpenTelemetryInterceporsAvoidsExtraYields'))
225
+ if (!(0, workflow_imports_1.getActivator)().hasFlag(workflow_imports_1.SdkFlags.OpenTelemetryInterceporsAvoidsExtraYields))
181
226
  await Promise.resolve();
182
227
  return next({
183
228
  ...input,
@@ -201,6 +246,21 @@ class OpenTelemetryOutboundInterceptor {
201
246
  return next(input);
202
247
  }
203
248
  }
249
+ getMetricTags(input, next) {
250
+ const span = otel.trace.getSpan(otel.context.active());
251
+ const spanContext = span?.spanContext();
252
+ if (spanContext && otel.isSpanContextValid(spanContext)) {
253
+ return next({
254
+ trace_id: spanContext.traceId,
255
+ span_id: spanContext.spanId,
256
+ trace_flags: `0${spanContext.traceFlags.toString(16)}`,
257
+ ...input,
258
+ });
259
+ }
260
+ else {
261
+ return next(input);
262
+ }
263
+ }
204
264
  }
205
265
  exports.OpenTelemetryOutboundInterceptor = OpenTelemetryOutboundInterceptor;
206
266
  class OpenTelemetryInternalsInterceptor {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workflow/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAiC;AACjC,uDAAuD;AACvD,qBAAmB,CAAC,uDAAuD;AAC3E,yDAA2C;AAC3C,uEAAyD;AAgBzD,wDAA+F;AAC/F,uDAAmD;AACnD,+CAAyD;AACzD,mDAA+C;AAC/C,qEAAqG;AAErG,gDAA8B;AAE9B,IAAI,MAAM,GAA4B,SAAS,CAAC;AAChD,IAAI,cAAc,GAA+B,SAAS,CAAC;AAE3D,SAAS,SAAS;IAChB,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;QACjC,cAAc,GAAG,IAAI,gCAAc,EAAE,CAAC;IACxC,CAAC;IACD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;QACnD,QAAQ,CAAC,gBAAgB,CAAC,IAAI,OAAO,CAAC,mBAAmB,CAAC,IAAI,4BAAY,EAAE,CAAC,CAAC,CAAC;QAC/E,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC;QACtC,MAAM,GAAG,QAAQ,CAAC,SAAS,CAAC,kCAAkC,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;G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AU,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;gBACtD,GAAG,KAAK;aACT,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;IAEM,aAAa,CAClB,KAAyB,EACzB,IAA6D;QAE7D,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QACvD,MAAM,WAAW,GAAG,IAAI,EAAE,WAAW,EAAE,CAAC;QACxC,IAAI,WAAW,IAAI,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAE,CAAC;YACxD,OAAO,IAAI,CAAC;gBACV,QAAQ,EAAE,WAAW,CAAC,OAAO;gBAC7B,OAAO,EAAE,WAAW,CAAC,MAAM;gBAC3B,WAAW,EAAE,IAAI,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;gBACtD,GAAG,KAAK;aACT,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;CACF;AA3JD,4EA2JC;AAED,MAAa,iCAAiC;IAC5C,KAAK,CAAC,OAAO,CAAC,KAAmB,EAAE,IAAmD;QACpF,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YACjC,cAAc,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,CAAC;IACd,CAAC;CACF;AAPD,8EAOC"}
@@ -4,9 +4,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  * Sets global variables required for importing opentelemetry in isolate
5
5
  * @module
6
6
  */
7
- const workflow_module_loader_1 = require("./workflow-module-loader");
8
- const inWorkflowContext = (0, workflow_module_loader_1.getWorkflowModuleIfAvailable)()?.inWorkflowContext;
9
- if (inWorkflowContext?.()) {
7
+ const workflow_imports_1 = require("./workflow-imports");
8
+ if ((0, workflow_imports_1.inWorkflowContext)()) {
10
9
  // Required by opentelemetry (pretend to be a browser)
11
10
  Object.assign(globalThis, {
12
11
  performance: {
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/workflow/runtime.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,qEAAwE;AAExE,MAAM,iBAAiB,GAAG,IAAA,qDAA4B,GAAE,EAAE,iBAAiB,CAAC;AAE5E,IAAI,iBAAiB,EAAE,EAAE,EAAE,CAAC;IAC1B,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;AACL,CAAC"}
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/workflow/runtime.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,yDAAuD;AAEvD,IAAI,IAAA,oCAAiB,GAAE,EAAE,CAAC;IACxB,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;AACL,CAAC"}
@@ -2,7 +2,7 @@ import * as tracing from '@opentelemetry/sdk-trace-base';
2
2
  import { ExportResult } from '@opentelemetry/core';
3
3
  import { SerializableSpan } from './definitions';
4
4
  export declare class SpanExporter implements tracing.SpanExporter {
5
- constructor();
5
+ private exporter?;
6
6
  export(spans: tracing.ReadableSpan[], resultCallback: (result: ExportResult) => void): void;
7
7
  shutdown(): Promise<void>;
8
8
  makeSerializable(span: tracing.ReadableSpan): SerializableSpan;
@@ -2,14 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SpanExporter = void 0;
4
4
  const core_1 = require("@opentelemetry/core");
5
- const workflow_module_loader_1 = require("./workflow-module-loader");
6
- const exporter = (0, workflow_module_loader_1.getWorkflowModuleIfAvailable)()?.proxySinks()?.exporter;
5
+ const workflow_imports_1 = require("./workflow-imports");
7
6
  class SpanExporter {
8
- constructor() {
9
- (0, workflow_module_loader_1.ensureWorkflowModuleLoaded)();
10
- }
7
+ exporter;
11
8
  export(spans, resultCallback) {
12
- exporter.export(spans.map((span) => this.makeSerializable(span)));
9
+ if (!this.exporter) {
10
+ this.exporter = (0, workflow_imports_1.proxySinks)().exporter;
11
+ }
12
+ this.exporter.export(spans.map((span) => this.makeSerializable(span)));
13
13
  resultCallback({ code: core_1.ExportResultCode.SUCCESS });
14
14
  }
15
15
  async shutdown() {
@@ -1 +1 @@
1
- {"version":3,"file":"span-exporter.js","sourceRoot":"","sources":["../../src/workflow/span-exporter.ts"],"names":[],"mappings":";;;AACA,8CAAqE;AAErE,qEAAoG;AAEpG,MAAM,QAAQ,GAAG,IAAA,qDAA4B,GAAE,EAAE,UAAU,EAAsB,EAAE,QAAQ,CAAC;AAE5F,MAAa,YAAY;IACvB;QACE,IAAA,mDAA0B,GAAE,CAAC;IAC/B,CAAC;IAEM,MAAM,CAAC,KAA6B,EAAE,cAA8C;QACzF,QAAS,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACnE,cAAc,CAAC,EAAE,IAAI,EAAE,uBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;IAEM,KAAK,CAAC,QAAQ;QACnB,uBAAuB;IACzB,CAAC;IAEM,gB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ACrD,CAAC;IAEM,KAAK,CAAC,QAAQ;QACnB,uBAAuB;IACzB,CAAC;IAEM,gBAAgB,CAAC,IAA0B;QAChD,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;YAC/B,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,sBAAsB,EAAE,IAAI,CAAC,sBAAsB;YACnD,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;YAC3C,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,sBAAsB,EAAE,IAAI,CAAC,sBAAsB;SACpD,CAAC;IACJ,CAAC;CACF;AAnCD,oCAmCC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Real workflow imports for otel interceptors.
3
+ * This replaces the stub via webpack alias when bundled.
4
+ *
5
+ * @module
6
+ */
7
+ export { inWorkflowContext, proxySinks, workflowInfo, AsyncLocalStorage, ContinueAsNew } from '@temporalio/workflow';
8
+ export { SdkFlags } from '@temporalio/workflow/lib/flags';
9
+ export { getActivator } from '@temporalio/workflow/lib/global-attributes';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getActivator = exports.SdkFlags = exports.ContinueAsNew = exports.AsyncLocalStorage = exports.workflowInfo = exports.proxySinks = exports.inWorkflowContext = void 0;
4
+ /**
5
+ * Real workflow imports for otel interceptors.
6
+ * This replaces the stub via webpack alias when bundled.
7
+ *
8
+ * @module
9
+ */
10
+ var workflow_1 = require("@temporalio/workflow");
11
+ Object.defineProperty(exports, "inWorkflowContext", { enumerable: true, get: function () { return workflow_1.inWorkflowContext; } });
12
+ Object.defineProperty(exports, "proxySinks", { enumerable: true, get: function () { return workflow_1.proxySinks; } });
13
+ Object.defineProperty(exports, "workflowInfo", { enumerable: true, get: function () { return workflow_1.workflowInfo; } });
14
+ Object.defineProperty(exports, "AsyncLocalStorage", { enumerable: true, get: function () { return workflow_1.AsyncLocalStorage; } });
15
+ Object.defineProperty(exports, "ContinueAsNew", { enumerable: true, get: function () { return workflow_1.ContinueAsNew; } });
16
+ var flags_1 = require("@temporalio/workflow/lib/flags");
17
+ Object.defineProperty(exports, "SdkFlags", { enumerable: true, get: function () { return flags_1.SdkFlags; } });
18
+ var global_attributes_1 = require("@temporalio/workflow/lib/global-attributes");
19
+ Object.defineProperty(exports, "getActivator", { enumerable: true, get: function () { return global_attributes_1.getActivator; } });
20
+ //# sourceMappingURL=workflow-imports-impl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-imports-impl.js","sourceRoot":"","sources":["../../src/workflow/workflow-imports-impl.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,iDAAqH;AAA5G,6GAAA,iBAAiB,OAAA;AAAE,sGAAA,UAAU,OAAA;AAAE,wGAAA,YAAY,OAAA;AAAE,6GAAA,iBAAiB,OAAA;AAAE,yGAAA,aAAa,OAAA;AACtF,wDAA0D;AAAjD,iGAAA,QAAQ,OAAA;AACjB,gFAA0E;AAAjE,iHAAA,YAAY,OAAA"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Workflow imports stub module.
3
+ *
4
+ * This module provides stubs for workflow functionality needed by interceptors.
5
+ * When bundled by the workflow bundler, this is replaced with the real
6
+ * implementation via NormalModuleReplacementPlugin.
7
+ *
8
+ * @module
9
+ */
10
+ import type { inWorkflowContext as inWorkflowContextT, workflowInfo as workflowInfoT, proxySinks as proxySinksT, AsyncLocalStorage as AsyncLocalStorageT, ContinueAsNew as ContinueAsNewT } from '@temporalio/workflow';
11
+ import type { getActivator as getActivatorT } from '@temporalio/workflow/lib/global-attributes';
12
+ import type { SdkFlags as SdkFlagsT } from '@temporalio/workflow/lib/flags';
13
+ export declare const inWorkflowContext: typeof inWorkflowContextT;
14
+ export declare const workflowInfo: typeof workflowInfoT;
15
+ export declare const ContinueAsNew: typeof ContinueAsNewT;
16
+ export declare const AsyncLocalStorage: typeof AsyncLocalStorageT;
17
+ export declare const getActivator: typeof getActivatorT;
18
+ export declare const proxySinks: typeof proxySinksT;
19
+ export declare const SdkFlags: typeof SdkFlagsT;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SdkFlags = exports.proxySinks = exports.getActivator = exports.AsyncLocalStorage = exports.ContinueAsNew = exports.workflowInfo = exports.inWorkflowContext = void 0;
4
+ const common_1 = require("@temporalio/common");
5
+ // always returns false since if using this implementation, we are outside of workflow context
6
+ const inWorkflowContext = () => false;
7
+ exports.inWorkflowContext = inWorkflowContext;
8
+ // All of the following stubs will throw if used
9
+ const workflowInfo = () => {
10
+ throw new common_1.IllegalStateError('Workflow.workflowInfo(...) may only be used from a Workflow Execution.');
11
+ };
12
+ exports.workflowInfo = workflowInfo;
13
+ exports.ContinueAsNew = class ContinueAsNew {
14
+ };
15
+ exports.AsyncLocalStorage = class AsyncLocalStorage {
16
+ };
17
+ const getActivator = () => {
18
+ throw new common_1.IllegalStateError('Workflow uninitialized');
19
+ };
20
+ exports.getActivator = getActivator;
21
+ const proxySinks = () => {
22
+ throw new common_1.IllegalStateError('Proxied sinks functions may only be used from a Workflow Execution.');
23
+ };
24
+ exports.proxySinks = proxySinks;
25
+ exports.SdkFlags = {};
26
+ //# sourceMappingURL=workflow-imports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-imports.js","sourceRoot":"","sources":["../../src/workflow/workflow-imports.ts"],"names":[],"mappings":";;;AAmBA,+CAAuD;AAEvD,8FAA8F;AACvF,MAAM,iBAAiB,GAA8B,GAAG,EAAE,CAAC,KAAK,CAAC;AAA3D,QAAA,iBAAiB,qBAA0C;AAExE,gDAAgD;AACzC,MAAM,YAAY,GAAyB,GAAG,EAAE;IACrD,MAAM,IAAI,0BAAiB,CAAC,wEAAwE,CAAC,CAAC;AACxG,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB;AAEW,QAAA,aAAa,GAAG,MAAM,aAAa;CAAuC,CAAC;AAE3E,QAAA,iBAAiB,GAAG,MAAM,iBAAiB;CAA2C,CAAC;AAE7F,MAAM,YAAY,GAAyB,GAAG,EAAE;IACrD,MAAM,IAAI,0BAAiB,CAAC,wBAAwB,CAAC,CAAC;AACxD,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB;AAEK,MAAM,UAAU,GAAuB,GAAG,EAAE;IACjD,MAAM,IAAI,0BAAiB,CAAC,qEAAqE,CAAC,CAAC;AACrG,CAAC,CAAC;AAFW,QAAA,UAAU,cAErB;AAEW,QAAA,QAAQ,GAAqB,EAAsB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@temporalio/interceptors-opentelemetry",
3
- "version": "1.13.2",
3
+ "version": "1.14.1",
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",
@@ -14,21 +14,21 @@
14
14
  "author": "Temporal Technologies Inc. <sdk@temporal.io>",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@opentelemetry/api": "^1.7.0",
18
- "@opentelemetry/core": "^1.19.0",
19
- "@opentelemetry/resources": "^1.19.0",
20
- "@opentelemetry/sdk-trace-base": "^1.19.0"
17
+ "@opentelemetry/api": "^1.9.0",
18
+ "@opentelemetry/core": "^1.25.1",
19
+ "@opentelemetry/resources": "^1.25.1",
20
+ "@opentelemetry/sdk-trace-base": "^1.25.1"
21
21
  },
22
22
  "devDependencies": {
23
- "@temporalio/activity": "1.13.2",
24
- "@temporalio/client": "1.13.2",
25
- "@temporalio/common": "1.13.2",
26
- "@temporalio/worker": "1.13.2",
27
- "@temporalio/workflow": "1.13.2"
23
+ "@temporalio/activity": "1.14.1",
24
+ "@temporalio/client": "1.14.1",
25
+ "@temporalio/common": "1.14.1",
26
+ "@temporalio/worker": "1.14.1",
27
+ "@temporalio/workflow": "1.14.1"
28
28
  },
29
29
  "peerDependencies": {
30
- "@temporalio/common": "1.13.2",
31
- "@temporalio/workflow": "1.13.2"
30
+ "@temporalio/common": "1.14.1",
31
+ "@temporalio/workflow": "1.14.1"
32
32
  },
33
33
  "peerDependenciesMeta": {
34
34
  "@temporalio/workflow": {
@@ -54,5 +54,5 @@
54
54
  "src",
55
55
  "lib"
56
56
  ],
57
- "gitHead": "cccc54c72f85377ac520b5d6cdd9a9a847027c27"
57
+ "gitHead": "42bf6087946b7bbda61c7856bc0723c1616f9973"
58
58
  }