@mastra/clickhouse 1.7.1-alpha.2 → 1.7.2-alpha.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/CHANGELOG.md +32 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +59 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +59 -5
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/observability/v-next/helpers.d.ts +2 -1
- package/dist/storage/domains/observability/v-next/helpers.d.ts.map +1 -1
- package/dist/storage/domains/observability/v-next/index.d.ts +2 -1
- package/dist/storage/domains/observability/v-next/index.d.ts.map +1 -1
- package/dist/storage/domains/observability/v-next/trace-roots.d.ts +2 -11
- package/dist/storage/domains/observability/v-next/trace-roots.d.ts.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @mastra/clickhouse
|
|
2
2
|
|
|
3
|
+
## 1.7.2-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Expose `GET /observability/traces/light` and storage support for fetching paginated trace-list rows without span payload data. ([#16608](https://github.com/mastra-ai/mastra/pull/16608))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`090a647`](https://github.com/mastra-ai/mastra/commit/090a647ba5a66d36f203f9f49457e03a1ff4e6fb), [`090a647`](https://github.com/mastra-ai/mastra/commit/090a647ba5a66d36f203f9f49457e03a1ff4e6fb), [`f84447d`](https://github.com/mastra-ai/mastra/commit/f84447d6c80f3471836a9b300d246b331fb47e0d), [`a1a5b3e`](https://github.com/mastra-ai/mastra/commit/a1a5b3e42ab2ca5161ea21db59ebf28442680fa7), [`af84f57`](https://github.com/mastra-ai/mastra/commit/af84f571ed762e92e8e61c5f9a72363520914274), [`8b3c6f9`](https://github.com/mastra-ai/mastra/commit/8b3c6f90f7879833ba7d1bc70937e1d8f69d0804)]:
|
|
10
|
+
- @mastra/core@1.34.0-alpha.3
|
|
11
|
+
|
|
12
|
+
## 1.7.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Fixed agent streams intermittently hanging when observability storage was backed by Replicated/Shared ClickHouse. Startup no longer re-applies no-op schema updates (e.g. `ADD COLUMN IF NOT EXISTS`, `ADD INDEX IF NOT EXISTS`, `MODIFY TTL`), so it no longer triggers replica-lag retry errors that could leave storage in a stuck state. ([#16420](https://github.com/mastra-ai/mastra/pull/16420))
|
|
17
|
+
|
|
18
|
+
- Respect optional `resourceId` in `getThreadById` so scoped thread lookups return `null` when the thread belongs to a different resource. ([#14237](https://github.com/mastra-ai/mastra/pull/14237))
|
|
19
|
+
|
|
20
|
+
Example:
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
const thread = await memory.getThreadById({
|
|
24
|
+
threadId: 'my-thread-id',
|
|
25
|
+
resourceId: 'my-user-id',
|
|
26
|
+
});
|
|
27
|
+
// Returns null if the thread does not belong to 'my-user-id'.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- Track `suspendedAt` and `suspendPayload` on background tasks. SQL adapters auto-migrate the new columns via `alterTable`. ([#16260](https://github.com/mastra-ai/mastra/pull/16260))
|
|
31
|
+
|
|
32
|
+
- Updated dependencies [[`9f17410`](https://github.com/mastra-ai/mastra/commit/9f1741080def23d42ee50b39887a385ae316a3c6), [`7ad5585`](https://github.com/mastra-ai/mastra/commit/7ad55856406f1de398dc713f6a9eaa78b2784bb6), [`ac47842`](https://github.com/mastra-ai/mastra/commit/ac478427aa7a5f5fdaed633a911218689b438c60), [`cc189cc`](https://github.com/mastra-ai/mastra/commit/cc189cc0128eb7af233476b5e421ec6888bffde7), [`d1fdbd0`](https://github.com/mastra-ai/mastra/commit/d1fdbd012add5623cb7e6b7f882b605ab358bbb4), [`210ea7a`](https://github.com/mastra-ai/mastra/commit/210ea7af559791b73a44fc9c12179908aaa3183f), [`7c275a8`](https://github.com/mastra-ai/mastra/commit/7c275a810595e1a6c41ccc39720531ab65734700), [`bae019e`](https://github.com/mastra-ai/mastra/commit/bae019ecb6694da96909f7ec7b9eb3a0a33aa887), [`890b24c`](https://github.com/mastra-ai/mastra/commit/890b24cc7d32ed6aa4dfe253e54dc6bf4099f690), [`f984b4d`](https://github.com/mastra-ai/mastra/commit/f984b4d6c60bf2ae2a9b156f0e8c35a66fe96c91), [`6742347`](https://github.com/mastra-ai/mastra/commit/6742347d71955d7639adc9ddf6ff8282de7ee3ba), [`b59316f`](https://github.com/mastra-ai/mastra/commit/b59316ffa0f7688165b0f9c81ccdf85da461e5b2), [`0f48ebf`](https://github.com/mastra-ai/mastra/commit/0f48ebfc7ac7897b2092a189f45751924cf56d1c), [`37c0dc5`](https://github.com/mastra-ai/mastra/commit/37c0dc5697d343db98628bf867bf71ce6deec6d7), [`087e413`](https://github.com/mastra-ai/mastra/commit/087e4133e5d6efa36619e9556c16750e4179c047), [`83218c8`](https://github.com/mastra-ai/mastra/commit/83218c88b37773c9424fbe733b37be556e55e94d), [`ef6b584`](https://github.com/mastra-ai/mastra/commit/ef6b5847ac33c0a7e80af3a86e8801e2933dd3ee), [`c6eb39e`](https://github.com/mastra-ai/mastra/commit/c6eb39ea6dca381c6563cb240237fbe608e02f93), [`7b0ad1f`](https://github.com/mastra-ai/mastra/commit/7b0ad1f5c53dc118c6da12ae82ae2587037dc2b8), [`d91ebe2`](https://github.com/mastra-ai/mastra/commit/d91ebe28ee065d8f2ed6df741c3c07f58d359529), [`62666c3`](https://github.com/mastra-ai/mastra/commit/62666c367eaeac3941ead454b1d38810cc855721), [`33f5061`](https://github.com/mastra-ai/mastra/commit/33f5061cd1c0335020c3faae61ce96de822854fa), [`4af2160`](https://github.com/mastra-ai/mastra/commit/4af2160322f4718cac421930cce85641e9512389), [`087e413`](https://github.com/mastra-ai/mastra/commit/087e4133e5d6efa36619e9556c16750e4179c047), [`265ec9f`](https://github.com/mastra-ai/mastra/commit/265ec9f887b5c81255c873a76ff7796f16e4f99b), [`ce01024`](https://github.com/mastra-ai/mastra/commit/ce010242eee9bdfc09e4c26725b9d37998679a8d), [`6ce80bf`](https://github.com/mastra-ai/mastra/commit/6ce80bf4872a891e0bddf8b80561a80584efb14b), [`f984b4d`](https://github.com/mastra-ai/mastra/commit/f984b4d6c60bf2ae2a9b156f0e8c35a66fe96c91), [`136c959`](https://github.com/mastra-ai/mastra/commit/136c9592fb0eeb0cd212f28629d8a29b7557a2fc), [`9268531`](https://github.com/mastra-ai/mastra/commit/9268531e7ec4be98beeba3b3ae8be0a7ea380662), [`13ead79`](https://github.com/mastra-ai/mastra/commit/13ead79149486b88144db7e11e6ff551caef5be1), [`dccd8f1`](https://github.com/mastra-ai/mastra/commit/dccd8f1f8b8f1ad203b77556207e5529567c616d), [`4df7cc7`](https://github.com/mastra-ai/mastra/commit/4df7cc79342fd065fe7fdeef93c094db14b12bcd), [`f180e49`](https://github.com/mastra-ai/mastra/commit/f180e4990e71b04c9a475b523584071712f0048f), [`9260e01`](https://github.com/mastra-ai/mastra/commit/9260e015276fb1b500f7878ee452b47476bf1583), [`2f6c54e`](https://github.com/mastra-ai/mastra/commit/2f6c54e17c041cac1def54baaa6b771647836414), [`aca3121`](https://github.com/mastra-ai/mastra/commit/aca31211233dac25459f140ea4fcfb3a5af64c18), [`e06a159`](https://github.com/mastra-ai/mastra/commit/e06a1598ca07a6c3778aefc2a2d288363c6294ff), [`4dd900d`](https://github.com/mastra-ai/mastra/commit/4dd900d75dfe9be89f8c15188b368a8622aa1e18), [`b560d6f`](https://github.com/mastra-ai/mastra/commit/b560d6f88b9b904b15c10f75c949eb145bc27684), [`99869ec`](https://github.com/mastra-ai/mastra/commit/99869ecb1f2aa6dfcc44fa4e843e5ee0344efa64), [`900d086`](https://github.com/mastra-ai/mastra/commit/900d086bb737b9cf2fcf68f11b0389b801a2738c), [`4c0e286`](https://github.com/mastra-ai/mastra/commit/4c0e28637c9cfb4f416549b55e97ebfa13319dfc), [`55f1e2d`](https://github.com/mastra-ai/mastra/commit/55f1e2d65425b95a49ae788053b266f256e38c96), [`4ff5bdf`](https://github.com/mastra-ai/mastra/commit/4ff5bdfe170cba6dfb5260c6af0f4ba668430772), [`9cdf38e`](https://github.com/mastra-ai/mastra/commit/9cdf38e58506e1109c8b38f97cd7770978a4218e), [`087e413`](https://github.com/mastra-ai/mastra/commit/087e4133e5d6efa36619e9556c16750e4179c047), [`db34bc6`](https://github.com/mastra-ai/mastra/commit/db34bc6fb36cf125bda0c46be4d3fdc774b70cc4), [`990851e`](https://github.com/mastra-ai/mastra/commit/990851edcb0e30be5c2c18b6532f1a876cc2d335), [`bbcd93c`](https://github.com/mastra-ai/mastra/commit/bbcd93cf7d8aa1007d6d84bfd033b8015c912087), [`8373ff4`](https://github.com/mastra-ai/mastra/commit/8373ff46745d77af79f183c4470f80fa2727a6b2), [`d48a705`](https://github.com/mastra-ai/mastra/commit/d48a705ff3dfbdc7a996e07ecd8293b5effd9a2a), [`308bd07`](https://github.com/mastra-ai/mastra/commit/308bd074f35cef0c75d82fc1eb19382fe04ecf6f), [`6068a6c`](https://github.com/mastra-ai/mastra/commit/6068a6c42950fad3ebfc92346417896ba60803d2), [`36b3bbf`](https://github.com/mastra-ai/mastra/commit/36b3bbf5a8d59f7e23d47e29340e76c681b4929c), [`d86f031`](https://github.com/mastra-ai/mastra/commit/d86f031eb6b0b2570145afafea664e59bf688962), [`b275631`](https://github.com/mastra-ai/mastra/commit/b275631dc10541a482b2e2d4a3e3cfa843bd5fa1), [`00106be`](https://github.com/mastra-ai/mastra/commit/00106bede59b81e5b0e9cd6aad8d3b5dbc336387), [`bd36d8e`](https://github.com/mastra-ai/mastra/commit/bd36d8eb6de8c9a0310352649dbd4b06703c2299), [`11c1528`](https://github.com/mastra-ai/mastra/commit/11c152848c5d0ef227184853b5040f5b41ee7b1e), [`4999667`](https://github.com/mastra-ai/mastra/commit/49996678b68356cad7f088430009690406c50fbd), [`e2a079c`](https://github.com/mastra-ai/mastra/commit/e2a079cc3755b1895f7bd5dc36e9be81b11c7c22), [`8ac9141`](https://github.com/mastra-ai/mastra/commit/8ac9141439caa8fdd674944c4d84f29b3c730296), [`25184ff`](https://github.com/mastra-ai/mastra/commit/25184ffaf1293ec95119426eb1a1f8d38831b96c), [`534a456`](https://github.com/mastra-ai/mastra/commit/534a456a25e4df1e5407e7e632f4cb3b1fa14f9d), [`105e454`](https://github.com/mastra-ai/mastra/commit/105e454c95af06a7c741c15969d8f9b0f02463a7), [`aebde9c`](https://github.com/mastra-ai/mastra/commit/aebde9cfacf56592c6b6350cae721740fe090b8a), [`36bae07`](https://github.com/mastra-ai/mastra/commit/36bae07c0e70b1b3006f2fd20830e8883dcbd066), [`5688881`](https://github.com/mastra-ai/mastra/commit/5688881669c7ed157f31ac77f6fc5f8d95ceea32)]:
|
|
33
|
+
- @mastra/core@1.33.0
|
|
34
|
+
|
|
3
35
|
## 1.7.1-alpha.2
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: mastra-clickhouse
|
|
|
3
3
|
description: Documentation for @mastra/clickhouse. Use when working with @mastra/clickhouse APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/clickhouse"
|
|
6
|
-
version: "1.7.
|
|
6
|
+
version: "1.7.2-alpha.0"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
package/dist/index.cjs
CHANGED
|
@@ -3687,6 +3687,26 @@ function rowToSpanRecord(row) {
|
|
|
3687
3687
|
updatedAt: null
|
|
3688
3688
|
};
|
|
3689
3689
|
}
|
|
3690
|
+
function rowToLightSpanRecord(row) {
|
|
3691
|
+
const startedAt = toDate(row.startedAt);
|
|
3692
|
+
const endedAt = row.isEvent ? startedAt : toDateOrNull(row.endedAt);
|
|
3693
|
+
return {
|
|
3694
|
+
traceId: row.traceId,
|
|
3695
|
+
spanId: row.spanId,
|
|
3696
|
+
parentSpanId: nullableString(row.parentSpanId),
|
|
3697
|
+
name: row.name,
|
|
3698
|
+
spanType: row.spanType,
|
|
3699
|
+
isEvent: Boolean(row.isEvent),
|
|
3700
|
+
startedAt,
|
|
3701
|
+
endedAt,
|
|
3702
|
+
entityType: nullableEntityType(row.entityType),
|
|
3703
|
+
entityId: nullableString(row.entityId),
|
|
3704
|
+
entityName: nullableString(row.entityName),
|
|
3705
|
+
error: parseJson(row.error) ?? void 0,
|
|
3706
|
+
createdAt: startedAt,
|
|
3707
|
+
updatedAt: null
|
|
3708
|
+
};
|
|
3709
|
+
}
|
|
3690
3710
|
function spanRecordToRow(span) {
|
|
3691
3711
|
const endedAt = span.isEvent ? span.startedAt : span.endedAt ?? span.startedAt;
|
|
3692
3712
|
const metadata = span.metadata ?? null;
|
|
@@ -5589,7 +5609,7 @@ async function getRootSpan(client, args) {
|
|
|
5589
5609
|
if (!rows || rows.length === 0) return null;
|
|
5590
5610
|
return { span: rowToSpanRecord(rows[0]) };
|
|
5591
5611
|
}
|
|
5592
|
-
async function
|
|
5612
|
+
async function listTraceRows(client, args, selectClause, mapRows) {
|
|
5593
5613
|
const { filters, pagination, orderBy } = storage.listTracesArgsSchema.parse(args);
|
|
5594
5614
|
const page = pagination?.page ?? 0;
|
|
5595
5615
|
const perPage = pagination?.perPage ?? 10;
|
|
@@ -5637,8 +5657,8 @@ async function listTraces(client, args) {
|
|
|
5637
5657
|
}
|
|
5638
5658
|
const dataResult = await client.query({
|
|
5639
5659
|
query: `
|
|
5640
|
-
SELECT
|
|
5641
|
-
SELECT
|
|
5660
|
+
SELECT ${selectClause} FROM (
|
|
5661
|
+
SELECT ${selectClause}
|
|
5642
5662
|
FROM ${TABLE_TRACE_ROOTS} r
|
|
5643
5663
|
${whereClause}
|
|
5644
5664
|
ORDER BY dedupeKey
|
|
@@ -5657,7 +5677,6 @@ async function listTraces(client, args) {
|
|
|
5657
5677
|
clickhouse_settings: CH_SETTINGS
|
|
5658
5678
|
});
|
|
5659
5679
|
const rows = await dataResult.json();
|
|
5660
|
-
const spans = rows.map(rowToSpanRecord);
|
|
5661
5680
|
return {
|
|
5662
5681
|
pagination: {
|
|
5663
5682
|
total,
|
|
@@ -5665,9 +5684,29 @@ async function listTraces(client, args) {
|
|
|
5665
5684
|
perPage,
|
|
5666
5685
|
hasMore: (page + 1) * perPage < total
|
|
5667
5686
|
},
|
|
5668
|
-
spans:
|
|
5687
|
+
spans: mapRows(rows)
|
|
5669
5688
|
};
|
|
5670
5689
|
}
|
|
5690
|
+
async function listTraces(client, args) {
|
|
5691
|
+
return listTraceRows(client, args, "*", (rows) => storage.toTraceSpans(rows.map(rowToSpanRecord)));
|
|
5692
|
+
}
|
|
5693
|
+
var LIGHT_TRACE_ROOT_COLUMNS = [
|
|
5694
|
+
"traceId",
|
|
5695
|
+
"spanId",
|
|
5696
|
+
"parentSpanId",
|
|
5697
|
+
"name",
|
|
5698
|
+
"spanType",
|
|
5699
|
+
"isEvent",
|
|
5700
|
+
"startedAt",
|
|
5701
|
+
"endedAt",
|
|
5702
|
+
"entityType",
|
|
5703
|
+
"entityId",
|
|
5704
|
+
"entityName",
|
|
5705
|
+
"error"
|
|
5706
|
+
].join(", ");
|
|
5707
|
+
async function listTracesLight(client, args) {
|
|
5708
|
+
return listTraceRows(client, args, LIGHT_TRACE_ROOT_COLUMNS, (rows) => rows.map(rowToLightSpanRecord));
|
|
5709
|
+
}
|
|
5671
5710
|
var BRANCH_SPAN_TYPE_SQL_LIST = storage.BRANCH_SPAN_TYPES.map((t) => `'${t}'`).join(", ");
|
|
5672
5711
|
async function createSpan(client, args) {
|
|
5673
5712
|
const row = spanRecordToRow(args.span);
|
|
@@ -6288,6 +6327,21 @@ var ObservabilityStorageClickhouseVNext = class extends storage.ObservabilitySto
|
|
|
6288
6327
|
);
|
|
6289
6328
|
}
|
|
6290
6329
|
}
|
|
6330
|
+
async listTracesLight(args) {
|
|
6331
|
+
try {
|
|
6332
|
+
return await listTracesLight(this.#client, args);
|
|
6333
|
+
} catch (error$1) {
|
|
6334
|
+
if (error$1 instanceof error.MastraError) throw error$1;
|
|
6335
|
+
throw new error.MastraError(
|
|
6336
|
+
{
|
|
6337
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "LIST_TRACES_LIGHT", "FAILED"),
|
|
6338
|
+
domain: error.ErrorDomain.STORAGE,
|
|
6339
|
+
category: error.ErrorCategory.THIRD_PARTY
|
|
6340
|
+
},
|
|
6341
|
+
error$1
|
|
6342
|
+
);
|
|
6343
|
+
}
|
|
6344
|
+
}
|
|
6291
6345
|
async listBranches(args) {
|
|
6292
6346
|
try {
|
|
6293
6347
|
return await listBranches(this.#client, args);
|