Skip to content

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

fix: fix trace tagging without postgres (#4639)

Max Deichmanne57af47d8454
diff --git a/web/src/server/api/routers/traces.ts b/web/src/server/api/routers/traces.ts
index e8c1796677..1a458b8252 100644
--- a/web/src/server/api/routers/traces.ts
+++ b/web/src/server/api/routers/traces.ts
@@ -878,17 +878,19 @@ export const traceRouter = createTRPCRouter({
after: input.tags,
});
- await ctx.prisma.trace.update({
- where: {
- id: input.traceId,
- projectId: input.projectId,
- },
- data: {
- tags: {
- set: input.tags,
+ if (env.LANGFUSE_POSTGRES_INGESTION_ENABLED === "true") {
+ await ctx.prisma.trace.update({
+ where: {
+ id: input.traceId,
+ projectId: input.projectId,
},
- },
- });
+ data: {
+ tags: {
+ set: input.tags,
+ },
+ },
+ });
+ }
if (env.CLICKHOUSE_URL) {
const clickhouseTrace = await getTraceById(
@@ -906,6 +908,9 @@ export const traceRouter = createTRPCRouter({
}
} catch (error) {
console.error(error);
+ throw new TRPCError({
+ code: "INTERNAL_SERVER_ERROR",
+ });
}
}),
});