@hozon/store-telemetry 0.2.0 → 0.2.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/lib/api.d.ts +1 -1
- package/lib/api.js +2 -1
- package/lib/migrations.d.ts +1 -2
- package/lib/tables.d.ts +2 -2
- package/package.json +3 -4
package/lib/api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Adapter } from '@hozon/adapter';
|
|
2
|
-
import type { Kysely } from '
|
|
2
|
+
import type { Kysely } from '@hozon/db';
|
|
3
3
|
import type { TelemetryTables } from './tables.js';
|
|
4
4
|
import type { TelemetryStore } from './types.js';
|
|
5
5
|
export declare function createTelemetryStoreAPI(db: Kysely<TelemetryTables>, adapter: Adapter): TelemetryStore;
|
package/lib/api.js
CHANGED
|
@@ -40,7 +40,8 @@ export function createTelemetryStoreAPI(db, adapter) {
|
|
|
40
40
|
},
|
|
41
41
|
async getSpans (traceID) {
|
|
42
42
|
const rows = await db.selectFrom('spans').select('data').where('trace_id', '=', traceID).orderBy('start_time').orderBy('seq').execute();
|
|
43
|
-
|
|
43
|
+
// Decode only the JSON column; nested JSON-looking strings are payload values.
|
|
44
|
+
return rows.map((row)=>typeof row.data === 'string' ? JSON.parse(row.data) : row.data);
|
|
44
45
|
},
|
|
45
46
|
async deleteByTrace (traceIDs) {
|
|
46
47
|
if (traceIDs.length === 0) return 0;
|
package/lib/migrations.d.ts
CHANGED
package/lib/tables.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ColumnType, Generated } from '
|
|
1
|
+
import type { ColumnType, Generated } from '@hozon/db';
|
|
2
2
|
import type { StoredSpan } from './types.js';
|
|
3
3
|
export type TelemetryTables = {
|
|
4
4
|
spans: {
|
|
@@ -7,6 +7,6 @@ export type TelemetryTables = {
|
|
|
7
7
|
span_id: string;
|
|
8
8
|
start_time: number;
|
|
9
9
|
end_time: number;
|
|
10
|
-
data: ColumnType<StoredSpan, unknown, unknown>;
|
|
10
|
+
data: ColumnType<StoredSpan | string, unknown, unknown>;
|
|
11
11
|
};
|
|
12
12
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hozon/store-telemetry",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Portable span store for Hozon",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,9 +18,8 @@
|
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@hozon/adapter": "^0.1.0",
|
|
21
|
-
"@hozon/db": "^0.2.
|
|
22
|
-
"@sozai/json": "^0.3.0"
|
|
23
|
-
"kysely": "^0.29.6"
|
|
21
|
+
"@hozon/db": "^0.2.3",
|
|
22
|
+
"@sozai/json": "^0.3.0"
|
|
24
23
|
},
|
|
25
24
|
"devDependencies": {
|
|
26
25
|
"@hozon/node-sqlite": "^0.1.0",
|