@illuma-ai/observability-node 0.1.0 → 0.2.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.
- package/dist/anthropic.d.ts +60 -0
- package/dist/anthropic.d.ts.map +1 -0
- package/dist/anthropic.js +164 -0
- package/dist/anthropic.js.map +1 -0
- package/dist/client.d.ts +12 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +20 -0
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/openai.d.ts +2 -0
- package/dist/openai.d.ts.map +1 -1
- package/dist/openai.js +32 -3
- package/dist/openai.js.map +1 -1
- package/dist/otel.d.ts +119 -0
- package/dist/otel.d.ts.map +1 -0
- package/dist/otel.js +405 -0
- package/dist/otel.js.map +1 -0
- package/dist/track.d.ts +126 -0
- package/dist/track.d.ts.map +1 -0
- package/dist/track.js +303 -0
- package/dist/track.js.map +1 -0
- package/package.json +13 -5
package/dist/track.js
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @track decorator for automatic function tracing.
|
|
3
|
+
*
|
|
4
|
+
* Uses `AsyncLocalStorage` from `node:async_hooks` for context propagation,
|
|
5
|
+
* enabling nested decorators to automatically create child spans under a
|
|
6
|
+
* parent trace. Supports both decorator syntax and function wrapping.
|
|
7
|
+
*
|
|
8
|
+
* Inspired by Opik's track decorator pattern.
|
|
9
|
+
*
|
|
10
|
+
* @example Function wrapping
|
|
11
|
+
* ```ts
|
|
12
|
+
* const tracedFn = track(myFunction, { name: 'my-operation' });
|
|
13
|
+
* await tracedFn(arg1, arg2);
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @example TC39 method decorator
|
|
17
|
+
* ```ts
|
|
18
|
+
* class MyService {
|
|
19
|
+
* @track({ name: 'process' })
|
|
20
|
+
* async process(input: string) { ... }
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example Nested tracing (child spans auto-linked to parent trace)
|
|
25
|
+
* ```ts
|
|
26
|
+
* const outer = track(async (x: number) => {
|
|
27
|
+
* return await inner(x + 1); // inner becomes a child span
|
|
28
|
+
* }, { name: 'outer' });
|
|
29
|
+
*
|
|
30
|
+
* const inner = track(async (x: number) => {
|
|
31
|
+
* return x * 2;
|
|
32
|
+
* }, { name: 'inner' });
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @module
|
|
36
|
+
*/
|
|
37
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
38
|
+
import { ObservationLevel } from '@illuma-ai/observability-core';
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
// AsyncLocalStorage & singleton client
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
const trackStorage = new AsyncLocalStorage();
|
|
43
|
+
let cachedClient = null;
|
|
44
|
+
/**
|
|
45
|
+
* Resolve an Observability client from options, cache, or lazy env-var initialization.
|
|
46
|
+
*
|
|
47
|
+
* @param options - Optional TrackOptions that may carry an explicit client.
|
|
48
|
+
* @returns An Observability instance.
|
|
49
|
+
*/
|
|
50
|
+
function getClient(options) {
|
|
51
|
+
if (options?.client)
|
|
52
|
+
return options.client;
|
|
53
|
+
if (cachedClient)
|
|
54
|
+
return cachedClient;
|
|
55
|
+
// Lazy-init from environment variables.
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
57
|
+
const { Observability: ObsCtor } = require('./client.js');
|
|
58
|
+
cachedClient = new ObsCtor();
|
|
59
|
+
return cachedClient;
|
|
60
|
+
}
|
|
61
|
+
// ---------------------------------------------------------------------------
|
|
62
|
+
// Promise detection helper
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
function isPromiseLike(value) {
|
|
65
|
+
return (value != null &&
|
|
66
|
+
typeof value === 'object' &&
|
|
67
|
+
typeof value.then === 'function');
|
|
68
|
+
}
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
// Core wrapper
|
|
71
|
+
// ---------------------------------------------------------------------------
|
|
72
|
+
/**
|
|
73
|
+
* Wrap a function so that every invocation is automatically traced.
|
|
74
|
+
*
|
|
75
|
+
* If an existing TrackContext is active (i.e. the caller is itself tracked),
|
|
76
|
+
* a child span is created under the parent trace. Otherwise a new root trace
|
|
77
|
+
* is created.
|
|
78
|
+
*
|
|
79
|
+
* Both synchronous and async (Promise-returning) functions are supported.
|
|
80
|
+
*
|
|
81
|
+
* @param fn - The original function to wrap.
|
|
82
|
+
* @param options - Optional configuration for naming, metadata, enrichment.
|
|
83
|
+
* @returns A new function with the same signature that traces every call.
|
|
84
|
+
*/
|
|
85
|
+
function wrapFunction(fn, options) {
|
|
86
|
+
const wrappedName = options?.name ?? fn.name ?? 'tracked';
|
|
87
|
+
const wrapped = function (...args) {
|
|
88
|
+
const parentCtx = trackStorage.getStore();
|
|
89
|
+
const client = getClient(options);
|
|
90
|
+
const input = args.length === 1 ? args[0] : { arguments: args };
|
|
91
|
+
if (parentCtx) {
|
|
92
|
+
// ----- Child span under an existing trace -----
|
|
93
|
+
const parent = parentCtx.currentSpan ?? parentCtx.trace;
|
|
94
|
+
const span = parent.span({
|
|
95
|
+
name: wrappedName,
|
|
96
|
+
input,
|
|
97
|
+
metadata: options?.metadata,
|
|
98
|
+
});
|
|
99
|
+
const childCtx = {
|
|
100
|
+
trace: parentCtx.trace,
|
|
101
|
+
currentSpan: span,
|
|
102
|
+
observability: client,
|
|
103
|
+
};
|
|
104
|
+
return trackStorage.run(childCtx, () => {
|
|
105
|
+
try {
|
|
106
|
+
const result = fn.apply(this, args);
|
|
107
|
+
if (isPromiseLike(result)) {
|
|
108
|
+
return result
|
|
109
|
+
.then((val) => {
|
|
110
|
+
const enrichment = options?.enrichSpan?.(val) ?? {};
|
|
111
|
+
span.end({ output: val, ...enrichment });
|
|
112
|
+
return val;
|
|
113
|
+
})
|
|
114
|
+
.catch((err) => {
|
|
115
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
116
|
+
span.end({
|
|
117
|
+
level: ObservationLevel.ERROR,
|
|
118
|
+
statusMessage: error.message,
|
|
119
|
+
output: { error: error.message },
|
|
120
|
+
metadata: {
|
|
121
|
+
exceptionType: error.name ?? 'Error',
|
|
122
|
+
traceback: error.stack ?? '',
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
throw err;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
const enrichment = options?.enrichSpan?.(result) ?? {};
|
|
129
|
+
span.end({ output: result, ...enrichment });
|
|
130
|
+
return result;
|
|
131
|
+
}
|
|
132
|
+
catch (err) {
|
|
133
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
134
|
+
span.end({
|
|
135
|
+
level: ObservationLevel.ERROR,
|
|
136
|
+
statusMessage: error.message,
|
|
137
|
+
output: { error: error.message },
|
|
138
|
+
metadata: {
|
|
139
|
+
exceptionType: error.name ?? 'Error',
|
|
140
|
+
traceback: error.stack ?? '',
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
throw err;
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
// ----- Root trace (no parent context) -----
|
|
148
|
+
const trace = client.trace({
|
|
149
|
+
name: wrappedName,
|
|
150
|
+
input,
|
|
151
|
+
metadata: options?.metadata,
|
|
152
|
+
});
|
|
153
|
+
const ctx = {
|
|
154
|
+
trace,
|
|
155
|
+
observability: client,
|
|
156
|
+
};
|
|
157
|
+
return trackStorage.run(ctx, () => {
|
|
158
|
+
try {
|
|
159
|
+
const result = fn.apply(this, args);
|
|
160
|
+
if (isPromiseLike(result)) {
|
|
161
|
+
return result
|
|
162
|
+
.then((val) => {
|
|
163
|
+
const enrichment = options?.enrichSpan?.(val) ?? {};
|
|
164
|
+
trace.update({ output: val, ...enrichment });
|
|
165
|
+
return val;
|
|
166
|
+
})
|
|
167
|
+
.catch((err) => {
|
|
168
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
169
|
+
trace.update({
|
|
170
|
+
metadata: {
|
|
171
|
+
error: error.message,
|
|
172
|
+
exceptionType: error.name ?? 'Error',
|
|
173
|
+
stack: error.stack,
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
throw err;
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
const enrichment = options?.enrichSpan?.(result) ?? {};
|
|
180
|
+
trace.update({ output: result, ...enrichment });
|
|
181
|
+
return result;
|
|
182
|
+
}
|
|
183
|
+
catch (err) {
|
|
184
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
185
|
+
trace.update({
|
|
186
|
+
metadata: {
|
|
187
|
+
error: error.message,
|
|
188
|
+
exceptionType: error.name ?? 'Error',
|
|
189
|
+
stack: error.stack,
|
|
190
|
+
},
|
|
191
|
+
});
|
|
192
|
+
throw err;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
Object.defineProperty(wrapped, 'name', { value: wrappedName });
|
|
197
|
+
return wrapped;
|
|
198
|
+
}
|
|
199
|
+
// ---------------------------------------------------------------------------
|
|
200
|
+
// Public API
|
|
201
|
+
// ---------------------------------------------------------------------------
|
|
202
|
+
/**
|
|
203
|
+
* Track a function execution as a trace or span.
|
|
204
|
+
*
|
|
205
|
+
* If called within an existing tracked context, creates a child span.
|
|
206
|
+
* Otherwise, creates a new root trace.
|
|
207
|
+
*
|
|
208
|
+
* **Usage patterns:**
|
|
209
|
+
*
|
|
210
|
+
* 1. **Function wrapper** (no options):
|
|
211
|
+
* ```ts
|
|
212
|
+
* const traced = track(myFn);
|
|
213
|
+
* ```
|
|
214
|
+
*
|
|
215
|
+
* 2. **Function wrapper** (with options):
|
|
216
|
+
* ```ts
|
|
217
|
+
* const traced = track(myFn, { name: 'myOp' });
|
|
218
|
+
* ```
|
|
219
|
+
*
|
|
220
|
+
* 3. **Higher-order** (returns a wrapper):
|
|
221
|
+
* ```ts
|
|
222
|
+
* const traced = track({ name: 'myOp' })(myFn);
|
|
223
|
+
* ```
|
|
224
|
+
*
|
|
225
|
+
* 4. **TC39 method decorator**:
|
|
226
|
+
* ```ts
|
|
227
|
+
* class Svc {
|
|
228
|
+
* @track({ name: 'myOp' })
|
|
229
|
+
* async run() { ... }
|
|
230
|
+
* }
|
|
231
|
+
* ```
|
|
232
|
+
*
|
|
233
|
+
* 5. **Legacy (experimental) method decorator**:
|
|
234
|
+
* ```ts
|
|
235
|
+
* class Svc {
|
|
236
|
+
* @track({ name: 'myOp' })
|
|
237
|
+
* async run() { ... }
|
|
238
|
+
* }
|
|
239
|
+
* ```
|
|
240
|
+
*
|
|
241
|
+
* @param fnOrOptions - Either the function to wrap, or a TrackOptions config object.
|
|
242
|
+
* @param optionsOrNothing - When `fnOrOptions` is a function, optional TrackOptions.
|
|
243
|
+
* @returns The wrapped function, or a decorator function.
|
|
244
|
+
*/
|
|
245
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
246
|
+
export function track(fnOrOptions, optionsOrNothing) {
|
|
247
|
+
// Called with a function directly: track(fn) or track(fn, options)
|
|
248
|
+
if (typeof fnOrOptions === 'function') {
|
|
249
|
+
return wrapFunction(fnOrOptions, optionsOrNothing);
|
|
250
|
+
}
|
|
251
|
+
// Called with options: @track({ name: 'foo' }) or track({ name: 'foo' })(fn)
|
|
252
|
+
const options = fnOrOptions;
|
|
253
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
254
|
+
return function decorator(...args) {
|
|
255
|
+
// TC39 decorator: (value, context) where context.kind === 'method'
|
|
256
|
+
if (args.length === 2 &&
|
|
257
|
+
typeof args[1] === 'object' &&
|
|
258
|
+
args[1] !== null &&
|
|
259
|
+
'kind' in args[1]) {
|
|
260
|
+
const [originalMethod, context] = args;
|
|
261
|
+
if (context.kind !== 'method') {
|
|
262
|
+
throw new Error('@track decorator can only be applied to methods');
|
|
263
|
+
}
|
|
264
|
+
return wrapFunction(originalMethod, options);
|
|
265
|
+
}
|
|
266
|
+
// Legacy (experimental) decorator: (target, propertyKey, descriptor)
|
|
267
|
+
if (args.length >= 2 &&
|
|
268
|
+
typeof args[2] === 'object' &&
|
|
269
|
+
args[2] !== null &&
|
|
270
|
+
'value' in args[2] &&
|
|
271
|
+
typeof args[2].value === 'function') {
|
|
272
|
+
const descriptor = args[2];
|
|
273
|
+
descriptor.value = wrapFunction(descriptor.value, options);
|
|
274
|
+
return descriptor;
|
|
275
|
+
}
|
|
276
|
+
// Plain higher-order call: track({ name: 'foo' })(fn)
|
|
277
|
+
if (args.length === 1 && typeof args[0] === 'function') {
|
|
278
|
+
return wrapFunction(args[0], options);
|
|
279
|
+
}
|
|
280
|
+
return args[0];
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Retrieve the current tracking context from AsyncLocalStorage.
|
|
285
|
+
*
|
|
286
|
+
* Useful for manual instrumentation when you need access to the active
|
|
287
|
+
* trace or span without using the @track decorator.
|
|
288
|
+
*
|
|
289
|
+
* @returns The current TrackContext, or undefined if not inside a tracked call.
|
|
290
|
+
*/
|
|
291
|
+
export function getCurrentTrackContext() {
|
|
292
|
+
return trackStorage.getStore();
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Reset the cached singleton Observability client.
|
|
296
|
+
*
|
|
297
|
+
* Intended for testing — allows the next `track` call to create a fresh client
|
|
298
|
+
* from environment variables.
|
|
299
|
+
*/
|
|
300
|
+
export function resetTrackClient() {
|
|
301
|
+
cachedClient = null;
|
|
302
|
+
}
|
|
303
|
+
//# sourceMappingURL=track.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"track.js","sourceRoot":"","sources":["../src/track.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,gBAAg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D,CAAC,CAAC;YACrE,CAAC;YAED,OAAO,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QAC/C,CAAC;QAED,qEAAqE;QACrE,IACE,IAAI,CAAC,MAAM,IAAI,CAAC;YAChB,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ;YAC3B,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI;YAChB,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC;YAClB,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,UAAU,EACnC,CAAC;YACD,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,CAAuB,CAAC;YACjD,UAAU,CAAC,KAAK,GAAG,YAAY,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC3D,OAAO,UAAU,CAAC;QACpB,CAAC;QAED,sDAAsD;QACtD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,UAAU,EAAE,CAAC;YACvD,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QACxC,CAAC;QAED,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO,YAAY,CAAC,QAAQ,EAAE,CAAC;AACjC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB;IAC9B,YAAY,GAAG,IAAI,CAAC;AACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@illuma-ai/observability-node",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Node.js SDK for Illuma Observability - LLM tracing and analytics",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
"types": "./dist/index.d.ts"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
-
"files": [
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
15
17
|
"scripts": {
|
|
16
18
|
"build": "tsc",
|
|
17
19
|
"test": "vitest run",
|
|
@@ -19,7 +21,7 @@
|
|
|
19
21
|
"prepublishOnly": "npm run build"
|
|
20
22
|
},
|
|
21
23
|
"dependencies": {
|
|
22
|
-
"@illuma-ai/observability-core": "^0.
|
|
24
|
+
"@illuma-ai/observability-core": "^0.2.0"
|
|
23
25
|
},
|
|
24
26
|
"devDependencies": {
|
|
25
27
|
"typescript": "^5.4.5",
|
|
@@ -34,6 +36,12 @@
|
|
|
34
36
|
"url": "https://github.com/illuma-ai/observability.git",
|
|
35
37
|
"directory": "packages/observability-node"
|
|
36
38
|
},
|
|
37
|
-
"license": "
|
|
38
|
-
"keywords": [
|
|
39
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
40
|
+
"keywords": [
|
|
41
|
+
"llm",
|
|
42
|
+
"observability",
|
|
43
|
+
"tracing",
|
|
44
|
+
"illuma",
|
|
45
|
+
"node"
|
|
46
|
+
]
|
|
39
47
|
}
|