@glassflow-ai/rius 0.5.0 → 0.6.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/README.md +15 -8
- package/dist/index.cjs +472 -109
- package/dist/index.d.cts +108 -6
- package/dist/index.d.ts +108 -6
- package/dist/index.js +458 -96
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -39,7 +39,8 @@ await client.ready;
|
|
|
39
39
|
|
|
40
40
|
// 1. Function wrapper — trace a whole call. Use a named function expression
|
|
41
41
|
// (or pass { name }): an arrow function has no inferrable name and its
|
|
42
|
-
// span would fall back to "anonymous".
|
|
42
|
+
// span would fall back to "anonymous". The wrapper always returns a
|
|
43
|
+
// Promise, even for a synchronous function.
|
|
43
44
|
const handle = observe(async function handle(query: string) {
|
|
44
45
|
return await callModel(query);
|
|
45
46
|
});
|
|
@@ -232,12 +233,13 @@ variables, then the defaults below.
|
|
|
232
233
|
| `disabled` | `RIUS_DISABLED` | `false` |
|
|
233
234
|
| `sampleRate` | `RIUS_SAMPLE_RATE` | `1.0` |
|
|
234
235
|
| `captureContent` | `RIUS_CAPTURE_CONTENT` | `true` |
|
|
235
|
-
| `mask` | (options only) | none
|
|
236
|
+
| `mask` | (options only) | none (`(value, { key }) => unknown`; the return value is stored, JSON-encoded if not a primitive; return `""` to blank) |
|
|
236
237
|
| `heartbeat` | `RIUS_HEARTBEAT` | `true` |
|
|
237
238
|
| `heartbeatInterval` | `RIUS_HEARTBEAT_INTERVAL` | `15` (seconds; clamped 5-300) |
|
|
238
239
|
| `agentName` | `RIUS_AGENT_NAME` | `serviceName` |
|
|
239
240
|
| `partialSpans` | `RIUS_PARTIAL_SPANS` | `false` |
|
|
240
241
|
| `partialSpansDelay` | `RIUS_PARTIAL_SPANS_DELAY` | `0` (seconds; clamped 0-60) |
|
|
242
|
+
| `sessionId` | `RIUS_SESSION_ID` | none (process-wide session default; `withSession` overrides it) |
|
|
241
243
|
|
|
242
244
|
Traces are posted to `<endpoint>/v1/traces`.
|
|
243
245
|
|
|
@@ -245,15 +247,20 @@ Traces are posted to `<endpoint>/v1/traces`.
|
|
|
245
247
|
completions, tool arguments) is attached to spans. It defaults to
|
|
246
248
|
`true`. Set it to `false`, or supply a `mask` function, if your spans
|
|
247
249
|
must not carry raw content. Both apply to span attributes and to the
|
|
248
|
-
attributes of span events and links
|
|
250
|
+
attributes of span events and links, including the `metadata.*` copies the
|
|
251
|
+
Vercel AI SDK transform makes of attributes it does not translate: a
|
|
252
|
+
`metadata.<key>` is content exactly when `<key>` is. With `captureContent: false` the
|
|
249
253
|
message and stacktrace of a recorded exception are stripped as well,
|
|
250
254
|
since provider errors routinely echo the request back; the exception
|
|
251
255
|
event and its `exception.type` are kept, so failures stay visible.
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
`captureContent
|
|
256
|
+
The span's ERROR status message carries the same string, so it is
|
|
257
|
+
blanked too; the status code stays. A `mask` function scrubs content
|
|
258
|
+
attributes on spans, events and links, and runs over the status message
|
|
259
|
+
as well (its `key` is `status.description`). It does not reach the
|
|
260
|
+
exception event: with `captureContent: true`, exception messages and
|
|
261
|
+
stacktraces pass through unmasked, so a raw provider error can still
|
|
262
|
+
reach your backend that way. Disable `captureContent` if you need those
|
|
263
|
+
scrubbed too.
|
|
257
264
|
|
|
258
265
|
`disabled` turns the SDK off completely: nothing is exported, and no
|
|
259
266
|
optional integration is loaded, so no third-party module is patched in your
|