🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
chore: add additional metrics into ingestion pipeline (#5160)
Steffen Schmitz5efcef593f09
diff --git a/worker/src/queues/ingestionQueue.ts b/worker/src/queues/ingestionQueue.tsindex 1601da2153..10d16ad189 100644--- a/worker/src/queues/ingestionQueue.ts+++ b/worker/src/queues/ingestionQueue.ts@@ -12,6 +12,7 @@ import {getClickhouseEntityType,getCurrentSpan,getQueue,+ recordHistogram,} from "@langfuse/shared/src/server";import { prisma } from "@langfuse/shared/src/db";@@ -93,9 +94,20 @@ export const ingestionQueueProcessorBuilder = ();// Download all events from folder into a local array+ const clickhouseEntityType = getClickhouseEntityType(+ job.data.payload.data.type,+ );const eventFiles = await s3Client.listFiles(- `${env.LANGFUSE_S3_EVENT_UPLOAD_PREFIX}${job.data.payload.authCheck.scope.projectId}/${getClickhouseEntityType(job.data.payload.data.type)}/${job.data.payload.data.eventBodyId}/`,+ `${env.LANGFUSE_S3_EVENT_UPLOAD_PREFIX}${job.data.payload.authCheck.scope.projectId}/${clickhouseEntityType}/${job.data.payload.data.eventBodyId}/`,+ );+ recordHistogram("langfuse.ingestion.count_files", eventFiles.length, {+ kind: clickhouseEntityType,+ });+ span?.setAttribute(+ "langfuse.ingestion.event.count_files",+ eventFiles.length,);+ span?.setAttribute("langfuse.ingestion.event.kind", clickhouseEntityType);const firstS3WriteTime =eventFilesdiff --git a/worker/src/services/IngestionService/index.ts b/worker/src/services/IngestionService/index.tsindex a82faf9bf7..45993476a3 100644--- a/worker/src/services/IngestionService/index.ts+++ b/worker/src/services/IngestionService/index.ts@@ -816,8 +816,16 @@ export class IngestionService {};}) {if (await this.shouldSkipClickHouseRead(params.projectId)) {+ recordIncrement("langfuse.ingestion.clickhouse_read_for_update", 1, {+ skipped: "true",+ table: params.table,+ });return null;}+ recordIncrement("langfuse.ingestion.clickhouse_read_for_update", 1, {+ skipped: "false",+ table: params.table,+ });const recordParser = {traces: traceRecordReadSchema,