Skip to content

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

chore: add attributes to ingestion queue processing (#4779)

Max Deichmannf14b69f68d67
diff --git a/worker/src/queues/ingestionQueue.ts b/worker/src/queues/ingestionQueue.ts
index b88ae4f1b6..edda34607a 100644
--- a/worker/src/queues/ingestionQueue.ts
+++ b/worker/src/queues/ingestionQueue.ts
@@ -10,6 +10,7 @@ import {
redis,
clickhouseClient,
getClickhouseEntityType,
+ getCurrentSpan,
} from "@langfuse/shared/src/server";
import { prisma } from "@langfuse/shared/src/db";
@@ -37,6 +38,23 @@ export const ingestionQueueProcessor: Processor = async (
job: Job<TQueueJobTypes[QueueName.IngestionQueue]>,
) => {
try {
+ const span = getCurrentSpan();
+ if (span) {
+ span.setAttribute("messaging.bullmq.job.input.id", job.data.id);
+ span.setAttribute(
+ "messaging.bullmq.job.input.projectId",
+ job.data.payload.authCheck.scope.projectId,
+ );
+ span.setAttribute(
+ "messaging.bullmq.job.input.eventBodyId",
+ job.data.payload.data.eventBodyId,
+ );
+ span.setAttribute(
+ "messaging.bullmq.job.input.type",
+ job.data.payload.data.type,
+ );
+ }
+
const s3Client = getS3StorageServiceClient(
env.LANGFUSE_S3_EVENT_UPLOAD_BUCKET,
);