Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

feat(worker): add posthog and mixpanel integrations to core data S3 export (#15960)

Steffen Schmitz2aa50493a3c7
diff --git a/worker/src/queues/coreDataS3ExportQueue.ts b/worker/src/queues/coreDataS3ExportQueue.ts
index a5d8663cac..b38c6d4fd7 100644
--- a/worker/src/queues/coreDataS3ExportQueue.ts
+++ b/worker/src/queues/coreDataS3ExportQueue.ts
@@ -385,6 +385,50 @@ const coreDataTableExports: Array<
},
}),
}),
+ (args) =>
+ uploadTableCoreDataJsonl({
+ ...args,
+ tableName: "posthogIntegrations",
+ // encryptedPosthogApiKey is excluded as it holds the project's API key
+ fetchPage: ({ lastRow, take }: TablePageArgs<{ projectId: string }>) =>
+ prisma.posthogIntegration.findMany({
+ take,
+ ...(lastRow
+ ? { cursor: { projectId: lastRow.projectId }, skip: 1 }
+ : {}),
+ orderBy: { projectId: "asc" },
+ select: {
+ projectId: true,
+ posthogHostName: true,
+ lastSyncAt: true,
+ enabled: true,
+ exportSource: true,
+ createdAt: true,
+ },
+ }),
+ }),
+ (args) =>
+ uploadTableCoreDataJsonl({
+ ...args,
+ tableName: "mixpanelIntegrations",
+ // encryptedMixpanelProjectToken is excluded as it holds the project token
+ fetchPage: ({ lastRow, take }: TablePageArgs<{ projectId: string }>) =>
+ prisma.mixpanelIntegration.findMany({
+ take,
+ ...(lastRow
+ ? { cursor: { projectId: lastRow.projectId }, skip: 1 }
+ : {}),
+ orderBy: { projectId: "asc" },
+ select: {
+ projectId: true,
+ mixpanelRegion: true,
+ lastSyncAt: true,
+ enabled: true,
+ exportSource: true,
+ createdAt: true,
+ },
+ }),
+ }),
(args) =>
uploadTableCoreDataJsonl({
...args,