@mastra/pg 1.9.2-alpha.0 → 1.9.2
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 +20 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-memory-storage.md +1 -0
- package/dist/index.cjs +45 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/observability/index.d.ts +2 -1
- package/dist/storage/domains/observability/index.d.ts.map +1 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -10153,6 +10153,51 @@ var ObservabilityPG = class _ObservabilityPG extends ObservabilityStorage {
|
|
|
10153
10153
|
);
|
|
10154
10154
|
}
|
|
10155
10155
|
}
|
|
10156
|
+
async getTraceLight(args) {
|
|
10157
|
+
const { traceId } = args;
|
|
10158
|
+
try {
|
|
10159
|
+
const tableName = getTableName2({
|
|
10160
|
+
indexName: TABLE_SPANS,
|
|
10161
|
+
schemaName: getSchemaName2(this.#schema)
|
|
10162
|
+
});
|
|
10163
|
+
const spans = await this.#db.client.manyOrNone(
|
|
10164
|
+
`SELECT
|
|
10165
|
+
"traceId", "spanId", "parentSpanId", "name",
|
|
10166
|
+
"entityType", "entityId", "entityName",
|
|
10167
|
+
"spanType", "error", "isEvent",
|
|
10168
|
+
"startedAtZ" as "startedAt", "endedAtZ" as "endedAt",
|
|
10169
|
+
"createdAtZ" as "createdAt", "updatedAtZ" as "updatedAt"
|
|
10170
|
+
FROM ${tableName}
|
|
10171
|
+
WHERE "traceId" = $1
|
|
10172
|
+
ORDER BY "startedAtZ" ASC`,
|
|
10173
|
+
[traceId]
|
|
10174
|
+
);
|
|
10175
|
+
if (!spans || spans.length === 0) {
|
|
10176
|
+
return null;
|
|
10177
|
+
}
|
|
10178
|
+
return {
|
|
10179
|
+
traceId,
|
|
10180
|
+
spans: spans.map(
|
|
10181
|
+
(span) => transformFromSqlRow({
|
|
10182
|
+
tableName: TABLE_SPANS,
|
|
10183
|
+
sqlRow: span
|
|
10184
|
+
})
|
|
10185
|
+
)
|
|
10186
|
+
};
|
|
10187
|
+
} catch (error) {
|
|
10188
|
+
throw new MastraError(
|
|
10189
|
+
{
|
|
10190
|
+
id: createStorageErrorId("PG", "GET_TRACE_LIGHT", "FAILED"),
|
|
10191
|
+
domain: ErrorDomain.STORAGE,
|
|
10192
|
+
category: ErrorCategory.USER,
|
|
10193
|
+
details: {
|
|
10194
|
+
traceId
|
|
10195
|
+
}
|
|
10196
|
+
},
|
|
10197
|
+
error
|
|
10198
|
+
);
|
|
10199
|
+
}
|
|
10200
|
+
}
|
|
10156
10201
|
async updateSpan(args) {
|
|
10157
10202
|
const { traceId, spanId, updates } = args;
|
|
10158
10203
|
try {
|