@codemation/host 0.2.5 → 0.3.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 +30 -0
- package/dist/{AppConfigFactory-CqKWXqOm.js → AppConfigFactory-BPp02HMv.js} +82 -5
- package/dist/{AppConfigFactory-CqKWXqOm.js.map → AppConfigFactory-BPp02HMv.js.map} +1 -1
- package/dist/{AppConfigFactory-CK28UPK0.d.ts → AppConfigFactory-Dq7ttwQ_.d.ts} +6001 -144
- package/dist/{AppContainerFactory-CcSGFNLW.js → AppContainerFactory-D9je1sSV.js} +2604 -155
- package/dist/AppContainerFactory-D9je1sSV.js.map +1 -0
- package/dist/{CodemationAppContext-KqDoeHqN.d.ts → CodemationAppContext-P7P-xZhQ.d.ts} +2 -2
- package/dist/{CodemationAuthoring.types-BP6Inucu.d.ts → CodemationAuthoring.types-OMYu7vKP.d.ts} +3 -3
- package/dist/{CodemationConfigNormalizer-DIAE0VHw.d.ts → CodemationConfigNormalizer-BCtBrJDe.d.ts} +2 -2
- package/dist/{CodemationConsumerConfigLoader-nj9kTmfJ.d.ts → CodemationConsumerConfigLoader-evvw4b_a.d.ts} +2 -2
- package/dist/CodemationPluginListMerger-PSTtEQjC.d.ts +674 -0
- package/dist/{CredentialServices-BFQD_VN1.d.ts → CredentialServices-0Hk8RFY1.d.ts} +3 -3
- package/dist/{CredentialServices-BPKUF8Xs.js → CredentialServices-BNBMFOPt.js} +6 -1
- package/dist/CredentialServices-BNBMFOPt.js.map +1 -0
- package/dist/{PublicFrontendBootstrapFactory-DTA1iDo0.d.ts → PublicFrontendBootstrapFactory-D0_ds7nS.d.ts} +2 -2
- package/dist/authoring.d.ts +3 -3
- package/dist/consumer.d.ts +4 -4
- package/dist/credentials.d.ts +3 -3
- package/dist/credentials.js +1 -1
- package/dist/devServerSidecar.d.ts +1 -1
- package/dist/{index-Dd6BrWyH.d.ts → index-CeS2saCe.d.ts} +105 -2
- package/dist/index.d.ts +12 -11
- package/dist/index.js +5 -5
- package/dist/nextServer.d.ts +8 -58
- package/dist/nextServer.js +6 -100
- package/dist/{persistenceServer-DKbFDxoS.js → persistenceServer-CA0_q0D7.js} +2 -2
- package/dist/{persistenceServer-DKbFDxoS.js.map → persistenceServer-CA0_q0D7.js.map} +1 -1
- package/dist/{persistenceServer-Y-u7lV7f.d.ts → persistenceServer-CJeu1STC.d.ts} +2 -2
- package/dist/persistenceServer.d.ts +5 -5
- package/dist/persistenceServer.js +2 -2
- package/dist/{server-CFpgKuVE.js → server-C_ZIEOTY.js} +4 -4
- package/dist/{server-CFpgKuVE.js.map → server-C_ZIEOTY.js.map} +1 -1
- package/dist/{server-axppTMgo.d.ts → server-Clvg5x1w.d.ts} +11 -5
- package/dist/server.d.ts +8 -8
- package/dist/server.js +5 -5
- package/package.json +6 -5
- package/prisma/migrations/20260414120000_telemetry_foundation/migration.sql +112 -0
- package/prisma/migrations/20260414153000_telemetry_retention_metrics_refactor/migration.sql +239 -0
- package/prisma/migrations.sqlite/20260414120000_telemetry_foundation/migration.sql +103 -0
- package/prisma/migrations.sqlite/20260414153000_telemetry_retention_metrics_refactor/migration.sql +540 -0
- package/prisma/schema.postgresql.prisma +100 -1
- package/prisma/schema.sqlite.prisma +100 -1
- package/scripts/generate-prisma-clients.mjs +89 -1
- package/src/application/contracts/TelemetryDashboardContracts.ts +113 -0
- package/src/application/contracts/TelemetryRunTraceContracts.ts +13 -0
- package/src/application/cost/FrameworkCostCatalogEntries.ts +126 -0
- package/src/application/queries/GetTelemetryDashboardDimensionsQuery.ts +11 -0
- package/src/application/queries/GetTelemetryDashboardDimensionsQueryHandler.ts +20 -0
- package/src/application/queries/GetTelemetryDashboardRunsQuery.ts +11 -0
- package/src/application/queries/GetTelemetryDashboardRunsQueryHandler.ts +20 -0
- package/src/application/queries/GetTelemetryDashboardSummaryQuery.ts +11 -0
- package/src/application/queries/GetTelemetryDashboardSummaryQueryHandler.ts +29 -0
- package/src/application/queries/GetTelemetryDashboardTimeseriesQuery.ts +11 -0
- package/src/application/queries/GetTelemetryDashboardTimeseriesQueryHandler.ts +36 -0
- package/src/application/queries/GetTelemetryRunTraceQuery.ts +8 -0
- package/src/application/queries/GetTelemetryRunTraceQueryHandler.ts +20 -0
- package/src/application/queries/WorkflowQueryHandlers.ts +5 -0
- package/src/application/runs/WorkflowRunRetentionPruneScheduler.ts +71 -26
- package/src/application/telemetry/CompositeTelemetryExporter.ts +13 -0
- package/src/application/telemetry/LazyExecutionTelemetryFactory.ts +21 -0
- package/src/application/telemetry/NoOpTelemetryExporter.ts +7 -0
- package/src/application/telemetry/OtelExecutionTelemetry.types.ts +41 -0
- package/src/application/telemetry/OtelExecutionTelemetryFactory.ts +56 -0
- package/src/application/telemetry/OtelIdentityFactory.ts +41 -0
- package/src/application/telemetry/RunEventBusTelemetryReporter.ts +188 -0
- package/src/application/telemetry/StoredExecutionTelemetry.ts +56 -0
- package/src/application/telemetry/StoredNodeExecutionTelemetry.ts +35 -0
- package/src/application/telemetry/StoredTelemetrySpanScope.ts +188 -0
- package/src/application/telemetry/TelemetryEnricherChain.ts +85 -0
- package/src/application/telemetry/TelemetryPrivacyPolicy.ts +19 -0
- package/src/application/telemetry/TelemetryQueryService.ts +815 -0
- package/src/application/telemetry/TelemetryRetentionTimestampFactory.ts +40 -0
- package/src/applicationTokens.ts +18 -0
- package/src/bootstrap/AppContainerFactory.ts +124 -1
- package/src/bootstrap/AppContainerLifecycle.ts +8 -0
- package/src/bootstrap/runtime/FrontendRuntime.ts +8 -0
- package/src/bootstrap/runtime/WorkerRuntime.ts +8 -0
- package/src/domain/runs/WorkflowRunRepository.ts +3 -1
- package/src/domain/telemetry/TelemetryContracts.ts +197 -0
- package/src/infrastructure/persistence/InMemoryRunTraceContextRepository.ts +56 -0
- package/src/infrastructure/persistence/InMemoryTelemetryArtifactStore.ts +56 -0
- package/src/infrastructure/persistence/InMemoryTelemetryMetricPointStore.ts +97 -0
- package/src/infrastructure/persistence/InMemoryTelemetrySpanStore.ts +113 -0
- package/src/infrastructure/persistence/InMemoryWorkflowRunRepository.ts +4 -2
- package/src/infrastructure/persistence/PrismaRunTraceContextRepository.ts +92 -0
- package/src/infrastructure/persistence/PrismaTelemetryArtifactStore.ts +125 -0
- package/src/infrastructure/persistence/PrismaTelemetryMetricPointStore.ts +134 -0
- package/src/infrastructure/persistence/PrismaTelemetrySpanStore.ts +166 -0
- package/src/infrastructure/persistence/PrismaWorkflowRunRepository.ts +20 -7
- package/src/infrastructure/persistence/generated/prisma-postgresql-client/edge.js +85 -4
- package/src/infrastructure/persistence/generated/prisma-postgresql-client/index-browser.js +81 -0
- package/src/infrastructure/persistence/generated/prisma-postgresql-client/index.d.ts +6488 -102
- package/src/infrastructure/persistence/generated/prisma-postgresql-client/index.js +85 -4
- package/src/infrastructure/persistence/generated/prisma-postgresql-client/package.json +1 -1
- package/src/infrastructure/persistence/generated/prisma-postgresql-client/schema.prisma +100 -0
- package/src/infrastructure/persistence/generated/prisma-sqlite-client/edge.js +85 -4
- package/src/infrastructure/persistence/generated/prisma-sqlite-client/index-browser.js +81 -0
- package/src/infrastructure/persistence/generated/prisma-sqlite-client/index.d.ts +6476 -98
- package/src/infrastructure/persistence/generated/prisma-sqlite-client/index.js +85 -4
- package/src/infrastructure/persistence/generated/prisma-sqlite-client/package.json +1 -1
- package/src/infrastructure/persistence/generated/prisma-sqlite-client/schema.prisma +100 -0
- package/src/presentation/http/ApiPaths.ts +22 -0
- package/src/presentation/http/hono/registrars/TelemetryHonoApiRouteRegistrar.ts +19 -0
- package/src/presentation/http/routeHandlers/TelemetryDashboardRequestError.ts +1 -0
- package/src/presentation/http/routeHandlers/TelemetryHttpRouteHandler.ts +181 -0
- package/dist/AppContainerFactory-CcSGFNLW.js.map +0 -1
- package/dist/CodemationPluginListMerger-QvUa2SIt.d.ts +0 -357
- package/dist/CredentialServices-BPKUF8Xs.js.map +0 -1
- package/dist/nextServer.js.map +0 -1
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
ALTER TABLE "RunTraceContext"
|
|
2
|
+
ADD COLUMN "expires_at" TEXT;
|
|
3
|
+
|
|
4
|
+
ALTER TABLE "RunTraceContext"
|
|
5
|
+
DROP CONSTRAINT "RunTraceContext_run_id_fkey";
|
|
6
|
+
|
|
7
|
+
ALTER TABLE "TelemetrySpan"
|
|
8
|
+
ADD COLUMN "retention_expires_at" TEXT;
|
|
9
|
+
|
|
10
|
+
ALTER TABLE "TelemetryArtifact"
|
|
11
|
+
ADD COLUMN "retention_expires_at" TEXT;
|
|
12
|
+
|
|
13
|
+
ALTER TABLE "TelemetrySpan"
|
|
14
|
+
DROP CONSTRAINT "TelemetrySpan_run_id_fkey";
|
|
15
|
+
|
|
16
|
+
ALTER TABLE "TelemetryArtifact"
|
|
17
|
+
DROP CONSTRAINT "TelemetryArtifact_run_id_fkey";
|
|
18
|
+
|
|
19
|
+
CREATE TABLE "TelemetryMetricPoint" (
|
|
20
|
+
"metric_point_id" TEXT NOT NULL,
|
|
21
|
+
"trace_id" TEXT,
|
|
22
|
+
"span_id" TEXT,
|
|
23
|
+
"run_id" TEXT,
|
|
24
|
+
"workflow_id" TEXT NOT NULL,
|
|
25
|
+
"node_id" TEXT,
|
|
26
|
+
"activation_id" TEXT,
|
|
27
|
+
"metric_name" TEXT NOT NULL,
|
|
28
|
+
"value" DOUBLE PRECISION NOT NULL,
|
|
29
|
+
"unit" TEXT,
|
|
30
|
+
"observed_at" TEXT NOT NULL,
|
|
31
|
+
"workflow_folder" TEXT,
|
|
32
|
+
"node_type" TEXT,
|
|
33
|
+
"node_role" TEXT,
|
|
34
|
+
"model_name" TEXT,
|
|
35
|
+
"dimensions_json" TEXT,
|
|
36
|
+
"retention_expires_at" TEXT,
|
|
37
|
+
|
|
38
|
+
CONSTRAINT "TelemetryMetricPoint_pkey" PRIMARY KEY ("metric_point_id")
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
INSERT INTO "TelemetryMetricPoint" (
|
|
42
|
+
"metric_point_id",
|
|
43
|
+
"trace_id",
|
|
44
|
+
"span_id",
|
|
45
|
+
"run_id",
|
|
46
|
+
"workflow_id",
|
|
47
|
+
"node_id",
|
|
48
|
+
"activation_id",
|
|
49
|
+
"metric_name",
|
|
50
|
+
"value",
|
|
51
|
+
"unit",
|
|
52
|
+
"observed_at",
|
|
53
|
+
"workflow_folder",
|
|
54
|
+
"node_type",
|
|
55
|
+
"node_role",
|
|
56
|
+
"model_name",
|
|
57
|
+
"dimensions_json",
|
|
58
|
+
"retention_expires_at"
|
|
59
|
+
)
|
|
60
|
+
SELECT
|
|
61
|
+
md5("telemetry_span_id" || ':gen_ai.usage.input_tokens'),
|
|
62
|
+
"trace_id",
|
|
63
|
+
"span_id",
|
|
64
|
+
"run_id",
|
|
65
|
+
"workflow_id",
|
|
66
|
+
"node_id",
|
|
67
|
+
"activation_id",
|
|
68
|
+
'gen_ai.usage.input_tokens',
|
|
69
|
+
"input_tokens",
|
|
70
|
+
NULL,
|
|
71
|
+
COALESCE("end_time", "start_time", "updated_at"),
|
|
72
|
+
"workflow_folder",
|
|
73
|
+
"node_type",
|
|
74
|
+
"node_role",
|
|
75
|
+
"model_name",
|
|
76
|
+
NULL,
|
|
77
|
+
NULL
|
|
78
|
+
FROM "TelemetrySpan"
|
|
79
|
+
WHERE "input_tokens" IS NOT NULL
|
|
80
|
+
UNION ALL
|
|
81
|
+
SELECT
|
|
82
|
+
md5("telemetry_span_id" || ':gen_ai.usage.output_tokens'),
|
|
83
|
+
"trace_id",
|
|
84
|
+
"span_id",
|
|
85
|
+
"run_id",
|
|
86
|
+
"workflow_id",
|
|
87
|
+
"node_id",
|
|
88
|
+
"activation_id",
|
|
89
|
+
'gen_ai.usage.output_tokens',
|
|
90
|
+
"output_tokens",
|
|
91
|
+
NULL,
|
|
92
|
+
COALESCE("end_time", "start_time", "updated_at"),
|
|
93
|
+
"workflow_folder",
|
|
94
|
+
"node_type",
|
|
95
|
+
"node_role",
|
|
96
|
+
"model_name",
|
|
97
|
+
NULL,
|
|
98
|
+
NULL
|
|
99
|
+
FROM "TelemetrySpan"
|
|
100
|
+
WHERE "output_tokens" IS NOT NULL
|
|
101
|
+
UNION ALL
|
|
102
|
+
SELECT
|
|
103
|
+
md5("telemetry_span_id" || ':gen_ai.usage.total_tokens'),
|
|
104
|
+
"trace_id",
|
|
105
|
+
"span_id",
|
|
106
|
+
"run_id",
|
|
107
|
+
"workflow_id",
|
|
108
|
+
"node_id",
|
|
109
|
+
"activation_id",
|
|
110
|
+
'gen_ai.usage.total_tokens',
|
|
111
|
+
"total_tokens",
|
|
112
|
+
NULL,
|
|
113
|
+
COALESCE("end_time", "start_time", "updated_at"),
|
|
114
|
+
"workflow_folder",
|
|
115
|
+
"node_type",
|
|
116
|
+
"node_role",
|
|
117
|
+
"model_name",
|
|
118
|
+
NULL,
|
|
119
|
+
NULL
|
|
120
|
+
FROM "TelemetrySpan"
|
|
121
|
+
WHERE "total_tokens" IS NOT NULL
|
|
122
|
+
UNION ALL
|
|
123
|
+
SELECT
|
|
124
|
+
md5("telemetry_span_id" || ':gen_ai.usage.cache_read.input_tokens'),
|
|
125
|
+
"trace_id",
|
|
126
|
+
"span_id",
|
|
127
|
+
"run_id",
|
|
128
|
+
"workflow_id",
|
|
129
|
+
"node_id",
|
|
130
|
+
"activation_id",
|
|
131
|
+
'gen_ai.usage.cache_read.input_tokens',
|
|
132
|
+
"cached_input_tokens",
|
|
133
|
+
NULL,
|
|
134
|
+
COALESCE("end_time", "start_time", "updated_at"),
|
|
135
|
+
"workflow_folder",
|
|
136
|
+
"node_type",
|
|
137
|
+
"node_role",
|
|
138
|
+
"model_name",
|
|
139
|
+
NULL,
|
|
140
|
+
NULL
|
|
141
|
+
FROM "TelemetrySpan"
|
|
142
|
+
WHERE "cached_input_tokens" IS NOT NULL
|
|
143
|
+
UNION ALL
|
|
144
|
+
SELECT
|
|
145
|
+
md5("telemetry_span_id" || ':codemation.gen_ai.usage.reasoning_tokens'),
|
|
146
|
+
"trace_id",
|
|
147
|
+
"span_id",
|
|
148
|
+
"run_id",
|
|
149
|
+
"workflow_id",
|
|
150
|
+
"node_id",
|
|
151
|
+
"activation_id",
|
|
152
|
+
'codemation.gen_ai.usage.reasoning_tokens',
|
|
153
|
+
"reasoning_tokens",
|
|
154
|
+
NULL,
|
|
155
|
+
COALESCE("end_time", "start_time", "updated_at"),
|
|
156
|
+
"workflow_folder",
|
|
157
|
+
"node_type",
|
|
158
|
+
"node_role",
|
|
159
|
+
"model_name",
|
|
160
|
+
NULL,
|
|
161
|
+
NULL
|
|
162
|
+
FROM "TelemetrySpan"
|
|
163
|
+
WHERE "reasoning_tokens" IS NOT NULL
|
|
164
|
+
UNION ALL
|
|
165
|
+
SELECT
|
|
166
|
+
md5("telemetry_span_id" || ':codemation.ai.turns'),
|
|
167
|
+
"trace_id",
|
|
168
|
+
"span_id",
|
|
169
|
+
"run_id",
|
|
170
|
+
"workflow_id",
|
|
171
|
+
"node_id",
|
|
172
|
+
"activation_id",
|
|
173
|
+
'codemation.ai.turns',
|
|
174
|
+
"turn_count",
|
|
175
|
+
NULL,
|
|
176
|
+
COALESCE("end_time", "start_time", "updated_at"),
|
|
177
|
+
"workflow_folder",
|
|
178
|
+
"node_type",
|
|
179
|
+
"node_role",
|
|
180
|
+
"model_name",
|
|
181
|
+
NULL,
|
|
182
|
+
NULL
|
|
183
|
+
FROM "TelemetrySpan"
|
|
184
|
+
WHERE "turn_count" IS NOT NULL
|
|
185
|
+
UNION ALL
|
|
186
|
+
SELECT
|
|
187
|
+
md5("telemetry_span_id" || ':codemation.ai.tool_calls'),
|
|
188
|
+
"trace_id",
|
|
189
|
+
"span_id",
|
|
190
|
+
"run_id",
|
|
191
|
+
"workflow_id",
|
|
192
|
+
"node_id",
|
|
193
|
+
"activation_id",
|
|
194
|
+
'codemation.ai.tool_calls',
|
|
195
|
+
"tool_call_count",
|
|
196
|
+
NULL,
|
|
197
|
+
COALESCE("end_time", "start_time", "updated_at"),
|
|
198
|
+
"workflow_folder",
|
|
199
|
+
"node_type",
|
|
200
|
+
"node_role",
|
|
201
|
+
"model_name",
|
|
202
|
+
NULL,
|
|
203
|
+
NULL
|
|
204
|
+
FROM "TelemetrySpan"
|
|
205
|
+
WHERE "tool_call_count" IS NOT NULL;
|
|
206
|
+
|
|
207
|
+
ALTER TABLE "TelemetrySpan"
|
|
208
|
+
DROP COLUMN "input_tokens",
|
|
209
|
+
DROP COLUMN "output_tokens",
|
|
210
|
+
DROP COLUMN "total_tokens",
|
|
211
|
+
DROP COLUMN "cached_input_tokens",
|
|
212
|
+
DROP COLUMN "cache_creation_input_tokens",
|
|
213
|
+
DROP COLUMN "reasoning_tokens",
|
|
214
|
+
DROP COLUMN "turn_count",
|
|
215
|
+
DROP COLUMN "tool_call_count";
|
|
216
|
+
|
|
217
|
+
CREATE INDEX "TelemetrySpan_retention_expires_at_idx"
|
|
218
|
+
ON "TelemetrySpan"("retention_expires_at");
|
|
219
|
+
|
|
220
|
+
CREATE INDEX "TelemetryArtifact_retention_expires_at_idx"
|
|
221
|
+
ON "TelemetryArtifact"("retention_expires_at");
|
|
222
|
+
|
|
223
|
+
CREATE INDEX "TelemetryMetricPoint_workflow_id_observed_at_idx"
|
|
224
|
+
ON "TelemetryMetricPoint"("workflow_id", "observed_at");
|
|
225
|
+
|
|
226
|
+
CREATE INDEX "TelemetryMetricPoint_workflow_id_metric_name_observed_at_idx"
|
|
227
|
+
ON "TelemetryMetricPoint"("workflow_id", "metric_name", "observed_at");
|
|
228
|
+
|
|
229
|
+
CREATE INDEX "TelemetryMetricPoint_run_id_observed_at_idx"
|
|
230
|
+
ON "TelemetryMetricPoint"("run_id", "observed_at");
|
|
231
|
+
|
|
232
|
+
CREATE INDEX "TelemetryMetricPoint_trace_id_observed_at_idx"
|
|
233
|
+
ON "TelemetryMetricPoint"("trace_id", "observed_at");
|
|
234
|
+
|
|
235
|
+
CREATE INDEX "TelemetryMetricPoint_model_name_observed_at_idx"
|
|
236
|
+
ON "TelemetryMetricPoint"("model_name", "observed_at");
|
|
237
|
+
|
|
238
|
+
CREATE INDEX "TelemetryMetricPoint_retention_expires_at_idx"
|
|
239
|
+
ON "TelemetryMetricPoint"("retention_expires_at");
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
CREATE TABLE "RunTraceContext" (
|
|
2
|
+
"run_id" TEXT NOT NULL PRIMARY KEY,
|
|
3
|
+
"workflow_id" TEXT NOT NULL,
|
|
4
|
+
"trace_id" TEXT NOT NULL,
|
|
5
|
+
"root_span_id" TEXT NOT NULL,
|
|
6
|
+
"service_name" TEXT,
|
|
7
|
+
"created_at" TEXT NOT NULL,
|
|
8
|
+
CONSTRAINT "RunTraceContext_run_id_fkey"
|
|
9
|
+
FOREIGN KEY ("run_id") REFERENCES "Run"("run_id") ON DELETE CASCADE ON UPDATE CASCADE
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
CREATE UNIQUE INDEX "RunTraceContext_trace_id_key"
|
|
13
|
+
ON "RunTraceContext"("trace_id");
|
|
14
|
+
|
|
15
|
+
CREATE INDEX "RunTraceContext_workflow_id_created_at_idx"
|
|
16
|
+
ON "RunTraceContext"("workflow_id", "created_at");
|
|
17
|
+
|
|
18
|
+
CREATE TABLE "TelemetrySpan" (
|
|
19
|
+
"telemetry_span_id" TEXT NOT NULL PRIMARY KEY,
|
|
20
|
+
"trace_id" TEXT NOT NULL,
|
|
21
|
+
"span_id" TEXT NOT NULL,
|
|
22
|
+
"parent_span_id" TEXT,
|
|
23
|
+
"run_id" TEXT NOT NULL,
|
|
24
|
+
"workflow_id" TEXT NOT NULL,
|
|
25
|
+
"node_id" TEXT,
|
|
26
|
+
"activation_id" TEXT,
|
|
27
|
+
"connection_invocation_id" TEXT,
|
|
28
|
+
"name" TEXT NOT NULL,
|
|
29
|
+
"kind" TEXT NOT NULL,
|
|
30
|
+
"status" TEXT,
|
|
31
|
+
"status_message" TEXT,
|
|
32
|
+
"start_time" TEXT,
|
|
33
|
+
"end_time" TEXT,
|
|
34
|
+
"workflow_folder" TEXT,
|
|
35
|
+
"node_type" TEXT,
|
|
36
|
+
"node_role" TEXT,
|
|
37
|
+
"model_name" TEXT,
|
|
38
|
+
"input_tokens" INTEGER,
|
|
39
|
+
"output_tokens" INTEGER,
|
|
40
|
+
"total_tokens" INTEGER,
|
|
41
|
+
"cached_input_tokens" INTEGER,
|
|
42
|
+
"cache_creation_input_tokens" INTEGER,
|
|
43
|
+
"reasoning_tokens" INTEGER,
|
|
44
|
+
"turn_count" INTEGER,
|
|
45
|
+
"tool_call_count" INTEGER,
|
|
46
|
+
"attributes_json" TEXT,
|
|
47
|
+
"events_json" TEXT,
|
|
48
|
+
"updated_at" TEXT NOT NULL,
|
|
49
|
+
CONSTRAINT "TelemetrySpan_run_id_fkey"
|
|
50
|
+
FOREIGN KEY ("run_id") REFERENCES "Run"("run_id") ON DELETE CASCADE ON UPDATE CASCADE
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
CREATE UNIQUE INDEX "TelemetrySpan_trace_id_span_id_key"
|
|
54
|
+
ON "TelemetrySpan"("trace_id", "span_id");
|
|
55
|
+
|
|
56
|
+
CREATE INDEX "TelemetrySpan_trace_id_start_time_idx"
|
|
57
|
+
ON "TelemetrySpan"("trace_id", "start_time");
|
|
58
|
+
|
|
59
|
+
CREATE INDEX "TelemetrySpan_workflow_id_end_time_idx"
|
|
60
|
+
ON "TelemetrySpan"("workflow_id", "end_time");
|
|
61
|
+
|
|
62
|
+
CREATE INDEX "TelemetrySpan_workflow_id_status_end_time_idx"
|
|
63
|
+
ON "TelemetrySpan"("workflow_id", "status", "end_time");
|
|
64
|
+
|
|
65
|
+
CREATE INDEX "TelemetrySpan_run_id_end_time_idx"
|
|
66
|
+
ON "TelemetrySpan"("run_id", "end_time");
|
|
67
|
+
|
|
68
|
+
CREATE INDEX "TelemetrySpan_model_name_end_time_idx"
|
|
69
|
+
ON "TelemetrySpan"("model_name", "end_time");
|
|
70
|
+
|
|
71
|
+
CREATE INDEX "TelemetrySpan_connection_invocation_id_idx"
|
|
72
|
+
ON "TelemetrySpan"("connection_invocation_id");
|
|
73
|
+
|
|
74
|
+
CREATE TABLE "TelemetryArtifact" (
|
|
75
|
+
"artifact_id" TEXT NOT NULL PRIMARY KEY,
|
|
76
|
+
"trace_id" TEXT NOT NULL,
|
|
77
|
+
"span_id" TEXT NOT NULL,
|
|
78
|
+
"run_id" TEXT NOT NULL,
|
|
79
|
+
"workflow_id" TEXT NOT NULL,
|
|
80
|
+
"node_id" TEXT,
|
|
81
|
+
"activation_id" TEXT,
|
|
82
|
+
"kind" TEXT NOT NULL,
|
|
83
|
+
"content_type" TEXT NOT NULL,
|
|
84
|
+
"preview_text" TEXT,
|
|
85
|
+
"preview_json" TEXT,
|
|
86
|
+
"payload_text" TEXT,
|
|
87
|
+
"payload_json" TEXT,
|
|
88
|
+
"bytes" INTEGER,
|
|
89
|
+
"truncated" BOOLEAN,
|
|
90
|
+
"created_at" TEXT NOT NULL,
|
|
91
|
+
"expires_at" TEXT,
|
|
92
|
+
CONSTRAINT "TelemetryArtifact_run_id_fkey"
|
|
93
|
+
FOREIGN KEY ("run_id") REFERENCES "Run"("run_id") ON DELETE CASCADE ON UPDATE CASCADE
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
CREATE INDEX "TelemetryArtifact_trace_id_created_at_idx"
|
|
97
|
+
ON "TelemetryArtifact"("trace_id", "created_at");
|
|
98
|
+
|
|
99
|
+
CREATE INDEX "TelemetryArtifact_span_id_created_at_idx"
|
|
100
|
+
ON "TelemetryArtifact"("span_id", "created_at");
|
|
101
|
+
|
|
102
|
+
CREATE INDEX "TelemetryArtifact_run_id_created_at_idx"
|
|
103
|
+
ON "TelemetryArtifact"("run_id", "created_at");
|