Skip to content

Commit 5d1ea8b

Browse files
committed
wip: stats
1 parent dba6e30 commit 5d1ea8b

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

infra/stats.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,15 @@ new sst.x.DevCommand("StatsStudio", {
144144
// APP
145145
////////////////
146146

147-
export const app = new sst.cloudflare.x.SolidStart("Stats", {
148-
path: "packages/stats/app",
149-
buildCommand: "bun run build",
150-
domain,
151-
link: [database],
152-
environment: {
153-
PUBLIC_URL: `https://${domain}`,
154-
},
155-
})
147+
// export const app = new sst.cloudflare.x.SolidStart("Stats", {
148+
// path: "packages/stats/app",
149+
// buildCommand: "bun run build",
150+
// domain,
151+
// link: [database],
152+
// environment: {
153+
// PUBLIC_URL: `https://${domain}`,
154+
// },
155+
// })
156156

157157
////////////////
158158
// SERVICES

packages/console/function/src/log-processor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function toLakeEvent(time: string, data: Record<string, unknown>) {
8989
const source = string(data, "source")
9090

9191
return {
92-
type: "inference.event",
92+
_datalake_key: "inference.event",
9393
event_timestamp: time,
9494
event_date: time.slice(0, 10),
9595
event_type: string(data, "event_type"),

packages/stats/server/src/ingest.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ const putRecords: (
9292
})
9393

9494
function routeEvent(event: IngestEvent): RoutedEvent | undefined {
95-
if (typeof event.type !== "string") return
96-
const match = event.type.match(LAKE_TYPE)
95+
if (typeof event._datalake_key !== "string") return
96+
const match = event._datalake_key.match(LAKE_TYPE)
9797
if (!match?.[1] || !match[2]) return
9898
return {
99-
...Object.fromEntries(Object.entries(event).filter(([key]) => key !== "type")),
99+
...Object.fromEntries(Object.entries(event).filter(([key]) => key !== "_datalake_key")),
100100
_lake_database: match[1],
101101
_lake_table: match[2],
102102
_lake_operation: "insert" as const,

sst.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default $config({
3131
const stage = await import("./infra/stage.js")
3232
await import("./infra/app.js")
3333
await import("./infra/lake.js")
34-
const stats = await import("./infra/stats.js")
34+
await import("./infra/stats.js")
3535
const { stat } = await import("./infra/console.js")
3636
await import("./infra/enterprise.js")
3737
if ($app.stage === "production" || $app.stage === "vimtor") {
@@ -40,7 +40,7 @@ export default $config({
4040

4141
return {
4242
StatWorkerUrl: stat.url,
43-
StatsUrl: stats.app.url,
43+
// StatsUrl: stats.app.url,
4444
...(stage.githubActionsDeployRoleArn ? { GithubActionsDeployRoleArn: stage.githubActionsDeployRoleArn } : {}),
4545
}
4646
},

0 commit comments

Comments
 (0)