@siglo/opentelemetry 1.0.3 → 1.2.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.
- package/README.md +21 -26
- package/dist/instrument.d.ts +5 -2
- package/dist/instrument.d.ts.map +1 -1
- package/dist/instrument.js +138 -51
- package/dist/instrument.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +14 -4
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ npm install @siglo/core @siglo/opentelemetry @opentelemetry/api
|
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
Recommended OpenTelemetry SDK packages for Node.js:
|
|
30
|
+
|
|
30
31
|
```bash
|
|
31
32
|
npm install --save-dev @opentelemetry/sdk-node @opentelemetry/sdk-trace-node @opentelemetry/exporter-trace-otlp-grpc
|
|
32
33
|
```
|
|
@@ -37,18 +38,18 @@ npm install --save-dev @opentelemetry/sdk-node @opentelemetry/sdk-trace-node @op
|
|
|
37
38
|
|
|
38
39
|
`SemanticAttributes` defines standardized OpenTelemetry attribute keys:
|
|
39
40
|
|
|
40
|
-
| Attribute Constant | String Key
|
|
41
|
-
|
|
|
42
|
-
| `WORKFLOW_NAME`
|
|
43
|
-
| `WORKFLOW_VERSION` | `siglo.workflow.version` | `string`
|
|
44
|
-
| `WORKFLOW_ID`
|
|
45
|
-
| `STACK_ID`
|
|
46
|
-
| `STEP_NAME`
|
|
47
|
-
| `STEP_ID`
|
|
48
|
-
| `STEP_ATTEMPT`
|
|
49
|
-
| `NAMESPACE`
|
|
50
|
-
| `CACHE_HIT`
|
|
51
|
-
| `TIMEOUT`
|
|
41
|
+
| Attribute Constant | String Key | Type | Description |
|
|
42
|
+
| :----------------- | :----------------------- | :-------- | :------------------------------------------------------------ |
|
|
43
|
+
| `WORKFLOW_NAME` | `siglo.workflow.name` | `string` | Canonical name of the executing workflow. |
|
|
44
|
+
| `WORKFLOW_VERSION` | `siglo.workflow.version` | `string` | Semantic version string of the workflow. |
|
|
45
|
+
| `WORKFLOW_ID` | `siglo.workflow.id` | `string` | Unique workflow identifier. |
|
|
46
|
+
| `STACK_ID` | `siglo.stack.id` | `string` | Unique stack execution identifier. |
|
|
47
|
+
| `STEP_NAME` | `siglo.step.name` | `string` | Name or debug label of the active step. |
|
|
48
|
+
| `STEP_ID` | `siglo.step.id` | `string` | Internal node identifier in the workflow graph AST. |
|
|
49
|
+
| `STEP_ATTEMPT` | `siglo.step.attempt` | `number` | 1-based attempt count (incremented on retries). |
|
|
50
|
+
| `NAMESPACE` | `siglo.namespace` | `string` | Tenant namespace partition (requires `allowNamespace: true`). |
|
|
51
|
+
| `CACHE_HIT` | `siglo.cache.hit` | `boolean` | `true` if step result was served from cache. |
|
|
52
|
+
| `TIMEOUT` | `siglo.timeout` | `number` | Configured timeout in milliseconds. |
|
|
52
53
|
|
|
53
54
|
---
|
|
54
55
|
|
|
@@ -61,12 +62,13 @@ Instruments a `Flow` instance with a root span, sets execution attributes, and a
|
|
|
61
62
|
```typescript
|
|
62
63
|
function instrumentWorkflow<TInput = any, TOutput = any>(
|
|
63
64
|
workflow: Flow<TInput, TOutput>,
|
|
64
|
-
options?: SigloTelemetryOptions
|
|
65
|
+
options?: SigloTelemetryOptions,
|
|
65
66
|
): Flow<TInput, TOutput>;
|
|
66
67
|
```
|
|
67
68
|
|
|
68
69
|
#### Options (`SigloTelemetryOptions`):
|
|
69
|
-
|
|
70
|
+
|
|
71
|
+
- `tracer` (`Tracer`): Custom OpenTelemetry `Tracer` instance. If omitted, uses `trace.getTracer('@siglo/opentelemetry', '1.0.4')`.
|
|
70
72
|
- `serviceName` (`string`): Tracer service name identifier.
|
|
71
73
|
- `workflowName` (`string`): Override workflow span label.
|
|
72
74
|
- `workflowVersion` (`string`): Workflow version (default: `'1.0.0'`).
|
|
@@ -83,7 +85,7 @@ Wraps an individual `Step` with a child span covering step execution, attempt co
|
|
|
83
85
|
```typescript
|
|
84
86
|
function instrumentStep<TInput = any, TOutput = any>(
|
|
85
87
|
step: Step<TInput, TOutput>,
|
|
86
|
-
options?: SigloTelemetryOptions
|
|
88
|
+
options?: SigloTelemetryOptions,
|
|
87
89
|
): Step<TInput, TOutput>;
|
|
88
90
|
```
|
|
89
91
|
|
|
@@ -98,6 +100,7 @@ function createTelemetryStorageAdapter(options?: SigloTelemetryOptions): Storage
|
|
|
98
100
|
```
|
|
99
101
|
|
|
100
102
|
#### Security & PII Protection:
|
|
103
|
+
|
|
101
104
|
By default, **no context fields are streamed to OpenTelemetry spans**. Only fields explicitly declared in `allowContextFields` are emitted as `siglo.context.<field>`, and all values pass through `redactHook` if configured.
|
|
102
105
|
|
|
103
106
|
---
|
|
@@ -117,11 +120,7 @@ import { NodeSDK } from '@opentelemetry/sdk-node';
|
|
|
117
120
|
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-grpc';
|
|
118
121
|
import { trace } from '@opentelemetry/api';
|
|
119
122
|
import { Step, flow } from '@siglo/core';
|
|
120
|
-
import {
|
|
121
|
-
instrumentWorkflow,
|
|
122
|
-
createTelemetryStorageAdapter,
|
|
123
|
-
getTraceHeaders
|
|
124
|
-
} from '@siglo/opentelemetry';
|
|
123
|
+
import { instrumentWorkflow, createTelemetryStorageAdapter, getTraceHeaders } from '@siglo/opentelemetry';
|
|
125
124
|
|
|
126
125
|
// 1. Initialize OpenTelemetry SDK
|
|
127
126
|
const sdk = new NodeSDK({
|
|
@@ -155,8 +154,7 @@ const chargePayment = Step.create('chargePayment', async (param: any) => {
|
|
|
155
154
|
throw new Error('Temporary payment gateway blip');
|
|
156
155
|
}
|
|
157
156
|
return { paymentStatus: 'CHARGED', cardLast4: '4242' };
|
|
158
|
-
})
|
|
159
|
-
.onFail({ maxRetries: 2, delay: 100 });
|
|
157
|
+
}).onFail({ maxRetries: 2, delay: 100 });
|
|
160
158
|
|
|
161
159
|
const orderWorkflow = flow(validateOrder, chargePayment);
|
|
162
160
|
|
|
@@ -169,10 +167,7 @@ const monitoredWorkflow = instrumentWorkflow(orderWorkflow, {
|
|
|
169
167
|
});
|
|
170
168
|
|
|
171
169
|
// 5. Run Monitored Workflow
|
|
172
|
-
const result = await monitoredWorkflow.run(
|
|
173
|
-
{ orderId: 'ORD-7718', totalAmount: 89.5 },
|
|
174
|
-
{ namespace: 'tenant-emea' }
|
|
175
|
-
);
|
|
170
|
+
const result = await monitoredWorkflow.run({ orderId: 'ORD-7718', totalAmount: 89.5 }, { namespace: 'tenant-emea' });
|
|
176
171
|
|
|
177
172
|
console.log('Workflow finished with Stack ID:', result.$stackId());
|
|
178
173
|
console.log('Outgoing W3C Headers for downstreams:', getTraceHeaders());
|
package/dist/instrument.d.ts
CHANGED
|
@@ -13,9 +13,12 @@ export declare function createTelemetryStorageAdapter(options?: SigloTelemetryOp
|
|
|
13
13
|
* Instruments an individual Step with an OpenTelemetry child span covering action execution,
|
|
14
14
|
* attempt counting, and error recording.
|
|
15
15
|
*/
|
|
16
|
-
export declare function instrumentStep<
|
|
16
|
+
export declare function instrumentStep<TStep extends Step<any, any, any>>(step: TStep, options?: SigloTelemetryOptions): TStep;
|
|
17
|
+
export declare function instrumentStep<TInput = any, TOutput = any, TName extends string = string>(step: Step<TInput, TOutput, TName>, options?: SigloTelemetryOptions): Step<TInput, TOutput, TName>;
|
|
17
18
|
/**
|
|
18
|
-
* Wraps a Flow execution with end-to-end OpenTelemetry spans and instruments child steps
|
|
19
|
+
* Wraps a Flow execution with end-to-end OpenTelemetry spans and instruments child steps automatically,
|
|
20
|
+
* including nested branch and when combinators, concurrent operations, and sub-flows.
|
|
19
21
|
*/
|
|
22
|
+
export declare function instrumentWorkflow<TFlow extends Flow<any, any>>(workflow: TFlow, options?: SigloTelemetryOptions): TFlow;
|
|
20
23
|
export declare function instrumentWorkflow<TInput = any, TOutput = any>(workflow: Flow<TInput, TOutput>, options?: SigloTelemetryOptions): Flow<TInput, TOutput>;
|
|
21
24
|
//# sourceMappingURL=instrument.d.ts.map
|
package/dist/instrument.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrument.d.ts","sourceRoot":"","sources":["../src/instrument.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"instrument.d.ts","sourceRoot":"","sources":["../src/instrument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC7G,OAAO,EACH,IAAI,EACJ,IAAI,EACJ,cAAc,EAIjB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAWhD;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAEjE;AAaD;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,GAAE,qBAA0B,GAAG,cAAc,CAsBjG;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,SAAS,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,KAAK,CAAC;AACvH,wBAAgB,cAAc,CAAC,MAAM,GAAG,GAAG,EAAE,OAAO,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,GAAG,MAAM,EACrF,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,EAClC,OAAO,CAAC,EAAE,qBAAqB,GAChC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AA0EhC;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,SAAS,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAC3D,QAAQ,EAAE,KAAK,EACf,OAAO,CAAC,EAAE,qBAAqB,GAChC,KAAK,CAAC;AACT,wBAAgB,kBAAkB,CAAC,MAAM,GAAG,GAAG,EAAE,OAAO,GAAG,GAAG,EAC1D,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,CAAC,EAAE,qBAAqB,GAChC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
|
package/dist/instrument.js
CHANGED
|
@@ -5,9 +5,15 @@ exports.createTelemetryStorageAdapter = createTelemetryStorageAdapter;
|
|
|
5
5
|
exports.instrumentStep = instrumentStep;
|
|
6
6
|
exports.instrumentWorkflow = instrumentWorkflow;
|
|
7
7
|
const api_1 = require("@opentelemetry/api");
|
|
8
|
+
const core_1 = require("@siglo/core");
|
|
8
9
|
const attributes_1 = require("./attributes");
|
|
9
10
|
const DEFAULT_TRACER_NAME = '@siglo/opentelemetry';
|
|
10
|
-
const DEFAULT_TRACER_VERSION = '1.0
|
|
11
|
+
const DEFAULT_TRACER_VERSION = '1.2.0';
|
|
12
|
+
const STEP_INSTRUMENTED = Symbol.for('siglo.opentelemetry.step_instrumented');
|
|
13
|
+
const WORKFLOW_INSTRUMENTED = Symbol.for('siglo.opentelemetry.workflow_instrumented');
|
|
14
|
+
const STEP_OPTIONS = Symbol.for('siglo.opentelemetry.step_options');
|
|
15
|
+
const ACTIVE_STEP_KEY = (0, api_1.createContextKey)('siglo.opentelemetry.active_step');
|
|
16
|
+
const ACTIVE_WORKFLOW_KEY = (0, api_1.createContextKey)('siglo.opentelemetry.active_workflow');
|
|
11
17
|
/**
|
|
12
18
|
* Returns an OpenTelemetry tracer based on configuration.
|
|
13
19
|
*/
|
|
@@ -48,23 +54,33 @@ function createTelemetryStorageAdapter(options = {}) {
|
|
|
48
54
|
},
|
|
49
55
|
};
|
|
50
56
|
}
|
|
51
|
-
/**
|
|
52
|
-
* Instruments an individual Step with an OpenTelemetry child span covering action execution,
|
|
53
|
-
* attempt counting, and error recording.
|
|
54
|
-
*/
|
|
55
57
|
function instrumentStep(step, options = {}) {
|
|
56
|
-
|
|
58
|
+
if (!step || typeof step !== 'object') {
|
|
59
|
+
return step;
|
|
60
|
+
}
|
|
61
|
+
step[STEP_OPTIONS] = options;
|
|
62
|
+
if (step[STEP_INSTRUMENTED]) {
|
|
63
|
+
return step;
|
|
64
|
+
}
|
|
57
65
|
const originalAction = step.action;
|
|
58
66
|
if (!originalAction) {
|
|
59
67
|
return step;
|
|
60
68
|
}
|
|
61
|
-
|
|
62
|
-
const isNamespaceAllowed = options.allowNamespace ?? false;
|
|
69
|
+
step[STEP_INSTRUMENTED] = true;
|
|
63
70
|
step.action = (async (param, current, index) => {
|
|
64
|
-
invocationCount++;
|
|
65
71
|
const stackId = resolveValue(param?.$stackId);
|
|
66
72
|
const retryCount = resolveValue(param?.$attempt);
|
|
67
|
-
const attempt = retryCount
|
|
73
|
+
const attempt = (retryCount ?? 0) + 1;
|
|
74
|
+
const stepId = step.$stepId || step.name || 'unnamed-step';
|
|
75
|
+
// Duplicate-instrumentation protection:
|
|
76
|
+
// If an active step span with this stepId and attempt is already active in otelContext
|
|
77
|
+
// (for example, created by workflow-level execution hook), do not create a duplicate span!
|
|
78
|
+
const activeStep = api_1.context.active().getValue(ACTIVE_STEP_KEY);
|
|
79
|
+
if (activeStep && activeStep.stepId === stepId && activeStep.attempt === attempt) {
|
|
80
|
+
return originalAction(param, current, index);
|
|
81
|
+
}
|
|
82
|
+
const tracer = getTracer(options);
|
|
83
|
+
const isNamespaceAllowed = options.allowNamespace ?? false;
|
|
68
84
|
const namespace = resolveValue(param?.$namespace);
|
|
69
85
|
const stepName = step.name || step.$stepId || 'unnamed-step';
|
|
70
86
|
const spanName = attempt > 1 ? `step:${stepName} (retry #${attempt})` : `step:${stepName}`;
|
|
@@ -74,13 +90,11 @@ function instrumentStep(step, options = {}) {
|
|
|
74
90
|
...(step.$stepId ? { [attributes_1.SemanticAttributes.STEP_ID]: step.$stepId } : {}),
|
|
75
91
|
[attributes_1.SemanticAttributes.STEP_ATTEMPT]: attempt,
|
|
76
92
|
...(stackId ? { [attributes_1.SemanticAttributes.STACK_ID]: stackId } : {}),
|
|
77
|
-
...(isNamespaceAllowed && namespace
|
|
78
|
-
? { [attributes_1.SemanticAttributes.NAMESPACE]: namespace }
|
|
79
|
-
: {}),
|
|
93
|
+
...(isNamespaceAllowed && namespace ? { [attributes_1.SemanticAttributes.NAMESPACE]: namespace } : {}),
|
|
80
94
|
...(step.timeoutMs ? { [attributes_1.SemanticAttributes.TIMEOUT]: step.timeoutMs } : {}),
|
|
81
95
|
},
|
|
82
96
|
});
|
|
83
|
-
const ctx = api_1.trace.setSpan(api_1.context.active(), stepSpan);
|
|
97
|
+
const ctx = api_1.trace.setSpan(api_1.context.active(), stepSpan).setValue(ACTIVE_STEP_KEY, { stepId, attempt });
|
|
84
98
|
return api_1.context.with(ctx, async () => {
|
|
85
99
|
try {
|
|
86
100
|
const result = await originalAction(param, current, index);
|
|
@@ -102,61 +116,134 @@ function instrumentStep(step, options = {}) {
|
|
|
102
116
|
});
|
|
103
117
|
return step;
|
|
104
118
|
}
|
|
105
|
-
/**
|
|
106
|
-
* Wraps a Flow execution with end-to-end OpenTelemetry spans and instruments child steps.
|
|
107
|
-
*/
|
|
108
119
|
function instrumentWorkflow(workflow, options = {}) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
instrumentStep(step, options);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
120
|
+
if (!workflow || typeof workflow !== 'object') {
|
|
121
|
+
return workflow;
|
|
122
|
+
}
|
|
123
|
+
if (workflow[WORKFLOW_INSTRUMENTED]) {
|
|
124
|
+
return workflow;
|
|
117
125
|
}
|
|
118
|
-
|
|
126
|
+
workflow[WORKFLOW_INSTRUMENTED] = true;
|
|
127
|
+
const tracer = getTracer(options);
|
|
119
128
|
const isNamespaceAllowed = options.allowNamespace ?? false;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
const
|
|
129
|
+
// Core runtime step execution hook: wraps every executed step action (including nested branch,
|
|
130
|
+
// when, parallel, map, sub-flows) with an active child span.
|
|
131
|
+
const stepExecutionHook = async (stepContext, next) => {
|
|
132
|
+
const stepId = stepContext.stepId || stepContext.step?.$stepId || stepContext.stepName;
|
|
133
|
+
const attempt = stepContext.attempt || 1;
|
|
134
|
+
// Duplicate-instrumentation protection:
|
|
135
|
+
if (stepContext.step?.[STEP_INSTRUMENTED]) {
|
|
136
|
+
return next();
|
|
137
|
+
}
|
|
138
|
+
const activeStep = api_1.context.active().getValue(ACTIVE_STEP_KEY);
|
|
139
|
+
if (activeStep && activeStep.stepId === stepId && activeStep.attempt === attempt) {
|
|
140
|
+
return next();
|
|
141
|
+
}
|
|
142
|
+
// Check if the step had explicit instrumentStep options configured
|
|
143
|
+
const stepSpecificOptions = stepContext.step?.[STEP_OPTIONS] || options;
|
|
144
|
+
const stepTracer = getTracer(stepSpecificOptions);
|
|
145
|
+
const stepNamespaceAllowed = stepSpecificOptions.allowNamespace ?? isNamespaceAllowed;
|
|
146
|
+
const stackId = resolveValue(stepContext.stackId || stepContext.param?.$stackId);
|
|
147
|
+
const namespace = resolveValue(stepContext.namespace || stepContext.param?.$namespace);
|
|
148
|
+
const stepName = stepContext.stepName || stepContext.step?.name || stepId || 'unnamed-step';
|
|
149
|
+
const spanName = attempt > 1 ? `step:${stepName} (retry #${attempt})` : `step:${stepName}`;
|
|
150
|
+
const stepSpan = stepTracer.startSpan(spanName, {
|
|
125
151
|
attributes: {
|
|
126
|
-
[attributes_1.SemanticAttributes.
|
|
127
|
-
[attributes_1.SemanticAttributes.
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
...(
|
|
132
|
-
? { [attributes_1.SemanticAttributes.TIMEOUT]: execOptions?.timeout || workflow.timeoutMs }
|
|
133
|
-
: {}),
|
|
152
|
+
[attributes_1.SemanticAttributes.STEP_NAME]: stepName,
|
|
153
|
+
...(stepId ? { [attributes_1.SemanticAttributes.STEP_ID]: stepId } : {}),
|
|
154
|
+
[attributes_1.SemanticAttributes.STEP_ATTEMPT]: attempt,
|
|
155
|
+
...(stackId ? { [attributes_1.SemanticAttributes.STACK_ID]: stackId } : {}),
|
|
156
|
+
...(stepNamespaceAllowed && namespace ? { [attributes_1.SemanticAttributes.NAMESPACE]: namespace } : {}),
|
|
157
|
+
...(stepContext.step?.timeoutMs ? { [attributes_1.SemanticAttributes.TIMEOUT]: stepContext.step.timeoutMs } : {}),
|
|
134
158
|
},
|
|
135
159
|
});
|
|
136
|
-
const ctx = api_1.trace.setSpan(api_1.context.active(),
|
|
160
|
+
const ctx = api_1.trace.setSpan(api_1.context.active(), stepSpan).setValue(ACTIVE_STEP_KEY, { stepId, attempt });
|
|
137
161
|
return api_1.context.with(ctx, async () => {
|
|
138
162
|
try {
|
|
139
|
-
const result = await
|
|
140
|
-
|
|
141
|
-
if (stackId) {
|
|
142
|
-
wfSpan.setAttribute(attributes_1.SemanticAttributes.STACK_ID, stackId);
|
|
143
|
-
}
|
|
144
|
-
wfSpan.setStatus({ code: api_1.SpanStatusCode.OK });
|
|
163
|
+
const result = await next();
|
|
164
|
+
stepSpan.setStatus({ code: api_1.SpanStatusCode.OK });
|
|
145
165
|
return result;
|
|
146
166
|
}
|
|
147
167
|
catch (err) {
|
|
148
|
-
|
|
149
|
-
|
|
168
|
+
stepSpan.recordException(err);
|
|
169
|
+
stepSpan.setStatus({
|
|
150
170
|
code: api_1.SpanStatusCode.ERROR,
|
|
151
|
-
message: err?.message || '
|
|
171
|
+
message: err?.message || 'Step execution failed',
|
|
152
172
|
});
|
|
153
173
|
throw err;
|
|
154
174
|
}
|
|
155
175
|
finally {
|
|
156
|
-
|
|
176
|
+
stepSpan.end();
|
|
157
177
|
}
|
|
158
178
|
});
|
|
159
|
-
}
|
|
179
|
+
};
|
|
180
|
+
const originalRun = typeof workflow.run === 'function' ? workflow.run.bind(workflow) : undefined;
|
|
181
|
+
const originalExecute = typeof workflow.execute === 'function' ? workflow.execute.bind(workflow) : undefined;
|
|
182
|
+
const originalStart = typeof workflow.start === 'function' ? workflow.start.bind(workflow) : undefined;
|
|
183
|
+
const wrapEntryPoint = (targetFn) => {
|
|
184
|
+
if (!targetFn)
|
|
185
|
+
return undefined;
|
|
186
|
+
return async (input, execOptions = {}) => {
|
|
187
|
+
// Execution entry-point coverage:
|
|
188
|
+
// If already inside an active workflow span, delegate to original without duplicate workflow span
|
|
189
|
+
const activeWf = api_1.context.active().getValue(ACTIVE_WORKFLOW_KEY);
|
|
190
|
+
if (activeWf) {
|
|
191
|
+
return targetFn(input, execOptions);
|
|
192
|
+
}
|
|
193
|
+
const workflowName = options.workflowName || workflow.name || 'workflow';
|
|
194
|
+
const workflowVersion = options.workflowVersion || workflow.workflowVersion || '1.0.0';
|
|
195
|
+
const namespace = execOptions?.namespace;
|
|
196
|
+
const wfSpan = tracer.startSpan(`workflow:${workflowName}`, {
|
|
197
|
+
attributes: {
|
|
198
|
+
[attributes_1.SemanticAttributes.WORKFLOW_NAME]: workflowName,
|
|
199
|
+
[attributes_1.SemanticAttributes.WORKFLOW_VERSION]: String(workflowVersion),
|
|
200
|
+
...(isNamespaceAllowed && namespace ? { [attributes_1.SemanticAttributes.NAMESPACE]: namespace } : {}),
|
|
201
|
+
...(execOptions?.timeout || workflow.timeoutMs
|
|
202
|
+
? { [attributes_1.SemanticAttributes.TIMEOUT]: execOptions?.timeout || workflow.timeoutMs }
|
|
203
|
+
: {}),
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
const ctx = api_1.trace.setSpan(api_1.context.active(), wfSpan).setValue(ACTIVE_WORKFLOW_KEY, wfSpan);
|
|
207
|
+
return api_1.context.with(ctx, async () => {
|
|
208
|
+
try {
|
|
209
|
+
const effectiveExecOptions = {
|
|
210
|
+
...execOptions,
|
|
211
|
+
stepExecutionHook,
|
|
212
|
+
};
|
|
213
|
+
const executeCall = () => targetFn(input, effectiveExecOptions);
|
|
214
|
+
const result = core_1.withStepExecutionHook
|
|
215
|
+
? await (0, core_1.withStepExecutionHook)(stepExecutionHook, executeCall)
|
|
216
|
+
: await executeCall();
|
|
217
|
+
const stackId = resolveValue(result?.$stackId);
|
|
218
|
+
if (stackId) {
|
|
219
|
+
wfSpan.setAttribute(attributes_1.SemanticAttributes.STACK_ID, stackId);
|
|
220
|
+
}
|
|
221
|
+
wfSpan.setStatus({ code: api_1.SpanStatusCode.OK });
|
|
222
|
+
return result;
|
|
223
|
+
}
|
|
224
|
+
catch (err) {
|
|
225
|
+
wfSpan.recordException(err);
|
|
226
|
+
wfSpan.setStatus({
|
|
227
|
+
code: api_1.SpanStatusCode.ERROR,
|
|
228
|
+
message: err?.message || 'Workflow execution failed',
|
|
229
|
+
});
|
|
230
|
+
throw err;
|
|
231
|
+
}
|
|
232
|
+
finally {
|
|
233
|
+
wfSpan.end();
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
if (originalRun) {
|
|
239
|
+
workflow.run = wrapEntryPoint(originalRun);
|
|
240
|
+
}
|
|
241
|
+
if (originalExecute) {
|
|
242
|
+
workflow.execute = wrapEntryPoint(originalExecute);
|
|
243
|
+
}
|
|
244
|
+
if (originalStart) {
|
|
245
|
+
workflow.start = wrapEntryPoint(originalStart);
|
|
246
|
+
}
|
|
160
247
|
return workflow;
|
|
161
248
|
}
|
|
162
249
|
//# sourceMappingURL=instrument.js.map
|
package/dist/instrument.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrument.js","sourceRoot":"","sources":["../src/instrument.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"instrument.js","sourceRoot":"","sources":["../src/instrument.ts"],"names":[],"mappings":";;AAwBA,8BAEC;AAgBD,sEAsBC;AAWD,wCAuEC;AAcD,gDA+IC;AA/SD,4CAA6G;AAC7G,sCAOqB;AACrB,6CAAkD;AAGlD,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AACnD,MAAM,sBAAsB,GAAG,OAAO,CAAC;AAEvC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;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AC,WAAW,CAAQ,CAAC;IACtD,CAAC;IACD,IAAI,eAAe,EAAE,CAAC;QAClB,QAAQ,CAAC,OAAO,GAAG,cAAc,CAAC,eAAe,CAAQ,CAAC;IAC9D,CAAC;IACD,IAAI,aAAa,EAAE,CAAC;QAChB,QAAQ,CAAC,KAAK,GAAG,cAAc,CAAC,aAAa,CAAQ,CAAC;IAC1D,CAAC;IAED,OAAO,QAAQ,CAAC;AACpB,CAAC"}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,WAAW,qBAAqB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CACzD;AAED,MAAM,WAAW,eAAe;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAChC,YAAY,EAAE,IAAI,CAAC;IACnB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;CAChC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,WAAW,qBAAqB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CACzD;AAED,MAAM,WAAW,eAAe;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAChC,YAAY,EAAE,IAAI,CAAC;IACnB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;CAChC;AAED,MAAM,MAAM,uBAAuB,GAAG,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@siglo/opentelemetry",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "OpenTelemetry
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "OpenTelemetry distributed tracing and trace context propagation for Siglo TypeScript workflows.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"bugs": {
|
|
38
38
|
"url": "https://github.com/jsoftgem/siglo/issues"
|
|
39
39
|
},
|
|
40
|
-
"homepage": "https://github.com/jsoftgem/siglo#readme",
|
|
40
|
+
"homepage": "https://github.com/jsoftgem/siglo/tree/main/packages/opentelemetry#readme",
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@opentelemetry/api": "^1.9.0",
|
|
43
43
|
"@siglo/core": "^1.0.0"
|
|
@@ -50,5 +50,15 @@
|
|
|
50
50
|
"mocha": "^12.0.3",
|
|
51
51
|
"tsx": "^4.23.15",
|
|
52
52
|
"typescript": "~5.7.0"
|
|
53
|
-
}
|
|
53
|
+
},
|
|
54
|
+
"keywords": [
|
|
55
|
+
"siglo",
|
|
56
|
+
"workflow",
|
|
57
|
+
"typescript",
|
|
58
|
+
"opentelemetry",
|
|
59
|
+
"otel",
|
|
60
|
+
"tracing",
|
|
61
|
+
"distributed-tracing",
|
|
62
|
+
"observability"
|
|
63
|
+
]
|
|
54
64
|
}
|