🪢 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
feat(observations-v2): add subquery-IN rewrite behind env flag (#14043)
Niklas Semmler3c89c86ddc4b
diff --git a/packages/shared/src/env.ts b/packages/shared/src/env.tsindex ee195d5525..0a74da5b36 100644--- a/packages/shared/src/env.ts+++ b/packages/shared/src/env.ts@@ -441,6 +441,11 @@ const EnvSchema = z.object({LANGFUSE_API_CLICKHOUSE_DISABLE_OBSERVATIONS_FINAL: z.enum(["true", "false"]).default("false"),+ // Temporary kill-switch for the observations v2 subquery-IN rewrite+ // (JOIN-free alternative to the CTE+JOIN split query).+ LANGFUSE_OBSERVATIONS_V2_SUBQUERY_REWRITE: z+ .enum(["true", "false"])+ .default("false"),// Enable Redis-based tracking of projects using OTEL API to optimize ClickHouse queries.// When enabled, projects ingesting via OTEL API skip the FINAL modifier on some observations queries for better performance.LANGFUSE_SKIP_FINAL_FOR_OTEL_PROJECTS: zdiff --git a/packages/shared/src/server/queries/clickhouse-sql/event-query-builder.test.ts b/packages/shared/src/server/queries/clickhouse-sql/event-query-builder.test.tsnew file mode 100644index 0000000000..2996efce96--- /dev/null+++ b/packages/shared/src/server/queries/clickhouse-sql/event-query-builder.test.ts@@ -0,0 +1,81 @@+import { describe, expect, it } from "vitest";++import {+ buildEventsFullTableSubqueryQuery,+ EventsQueryBuilder,+} from "./event-query-builder";++describe("buildEventsFullTableSubqueryQuery", () => {+ const buildInner = () =>+ new EventsQueryBuilder({ projectId: "test-project" })+ .whereRaw("e.trace_id = {traceId: String}", { traceId: "trace-1" })+ .orderByColumns([+ { column: "e.start_time", direction: "DESC" },+ { column: "xxHash32(e.trace_id)", direction: "DESC" },+ { column: "e.span_id", direction: "DESC" },+ ])+ .limit(51, undefined);++ it("compiles the full query", () => {+ const { query, params } = buildEventsFullTableSubqueryQuery({+ projectId: "test-project",+ innerBuilder: buildInner(),+ fieldSetNames: ["core", "io"],+ }).buildWithParams();++ expect(query).toMatchInlineSnapshot(`+ "SELECT+ e.span_id as id,+ e.trace_id as "trace_id",+ e.start_time as "start_time",+ e.end_time as "end_time",+ e.project_id as "project_id",+ e.parent_span_id as "parent_observation_id",+ e.type as type,+ e.input,+ e.output+ FROM events_full e+ WHERE e.project_id = {projectId: String}+ AND (e.span_id, e.trace_id, e.start_time, e.project_id) IN (+ SELECT+ e.span_id,+ e.trace_id,+ e.start_time,+ e.project_id+ FROM events_core e+ WHERE e.project_id = {projectId: String}+ AND e.trace_id = {traceId: String}+ ORDER BY e.project_id DESC, toStartOfMinute(e.start_time) DESC, e.start_time DESC, xxHash32(e.trace_id) DESC, e.span_id DESC+ LIMIT {limit: Int32}+ )+ ORDER BY e.project_id DESC, toStartOfMinute(e.start_time) DESC, e.start_time DESC, xxHash32(e.trace_id) DESC, e.span_id DESC"+ `);+ expect(params).toMatchInlineSnapshot(`+ {+ "limit": 51,+ "projectId": "test-project",+ "traceId": "trace-1",+ }+ `);+ });++ it("throws if the inner builder already carries a projection", () => {+ const withFieldSet = buildInner().selectFieldSet("core");+ expect(() =>+ buildEventsFullTableSubqueryQuery({+ projectId: "test-project",+ innerBuilder: withFieldSet,+ fieldSetNames: ["core"],+ }),+ ).toThrow(/without SELECT expressions/);++ const withIO = buildInner().selectIO(false);+ expect(() =>+ buildEventsFullTableSubqueryQuery({+ projectId: "test-project",+ innerBuilder: withIO,+ fieldSetNames: ["core"],+ }),+ ).toThrow(/without SELECT expressions/);+ });+});diff --git a/packages/shared/src/server/queries/clickhouse-sql/event-query-builder.ts b/packages/shared/src/server/queries/clickhouse-sql/event-query-builder.tsindex ec0eb0449c..4734fad7b5 100644--- a/packages/shared/src/server/queries/clickhouse-sql/event-query-builder.ts+++ b/packages/shared/src/server/queries/clickhouse-sql/event-query-builder.ts@@ -510,6 +510,14 @@ abstract class AbstractQueryBuilder {protected whereClauses: string[] = [];protected havingClauses: string[] = [];protected orderByClause: string = "";++ /**+ * The built ORDER BY clause (empty string if none was set). Lets wrapper+ * queries re-apply an inner builder's exact sort.+ */+ getOrderByClause(): string {+ return this.orderByClause;+ }protected limitByClause: string = "";protected limitClause: string = "";protected params: Record<string, any> = {};@@ -988,6 +996,18 @@ export class EventsQueryBuilder extends BaseEventsQueryBuilder<return this;}+ /**+ * True if any projection (field set, raw expression, or IO selection) has+ * been added.+ */+ hasSelectExpressions(): boolean {+ return (+ this.selectFields.size > 0 ||+ this.rawSelectExpressions.length > 0 ||+ this.ioFields !== null+ );+ }+/*** Add SELECT fields from predefined field sets*/@@ -1978,3 +1998,79 @@ export function buildEventsFullTableSplitQuery(opts: {return cteBuilder as unknown as SplitQueryBuilder;}++/**+ * Identity tuple for the subquery-IN rewrite. The inner subquery projects+ * exactly these columns; the outer IN clause matches them positionally.+ */+const SUBQUERY_IDENTITY_TUPLE = [+ "e.span_id",+ "e.trace_id",+ "e.start_time",+ "e.project_id",+] as const;++/**+ * Build the observations v2 subquery-IN late-materialization query: an outer+ * SELECT on events_full gated by an identity-tuple IN subquery that runs the+ * filter/sort/limit on the inner builder's table. No JOIN — ClickHouse builds+ * the inner hash set once and prunes the outer scan.+ *+ * The inner builder must carry filters, ORDER BY, and LIMIT but no SELECTs;+ * this function projects the identity tuple itself. Counterpart of+ * buildEventsFullTableSplitQuery; both must return identical result sets.+ */+export function buildEventsFullTableSubqueryQuery(opts: {+ projectId: string;+ innerBuilder: EventsQueryBuilder;+ fieldSetNames: FieldSetName[];+}): QueryWithParams {+ // A pre-existing projection on the inner builder would misalign the+ // positional IN-tuple match — fail fast.+ if (opts.innerBuilder.hasSelectExpressions()) {+ throw new Error(+ "buildEventsFullTableSubqueryQuery requires an inner builder without SELECT expressions; it projects the identity tuple itself",+ );+ }+ const { query: innerQuery, params: innerParams } = opts.innerBuilder+ .selectRaw(...SUBQUERY_IDENTITY_TUPLE)+ .buildWithParams();++ // Outer SELECT: core + requested field groups from events_full, deduped.+ const fieldKeys = Array.from(+ new Set(opts.fieldSetNames.flatMap((name) => FIELD_SETS[name])),+ );+ const outerSelect = fieldKeys.flatMap((key) => {+ const expr = EVENTS_FIELDS[key as keyof typeof EVENTS_FIELDS];+ return expr ? [expr] : [];+ });++ // Re-apply the inner builder's ORDER BY verbatim (same `e.` prefix);+ // IN does not preserve order, and the cursor is derived from the last+ // returned row, so keyset pagination depends on this sort.+ const outerOrderBy = opts.innerBuilder.getOrderByClause();+ if (!outerOrderBy) {+ throw new Error(+ "buildEventsFullTableSubqueryQuery requires the inner builder to carry an ORDER BY; keyset pagination depends on it",+ );+ }++ // Inner params last so the inner subquery's bindings win on overlap.+ const params: Record<string, any> = {+ projectId: opts.projectId,+ ...innerParams,+ };++ const tuple = `(${SUBQUERY_IDENTITY_TUPLE.join(", ")})`;+ const queryParts: string[] = [];+ queryParts.push(+ `SELECT\n ${outerSelect.join(",\n ")}`,+ "FROM events_full e",+ "WHERE e.project_id = {projectId: String}",+ ` AND ${tuple} IN (\n${innerQuery}\n)`,+ outerOrderBy,+ );++ const query = queryParts.join("\n");+ return { buildWithParams: () => ({ query, params }) };+}diff --git a/packages/shared/src/server/queries/clickhouse-sql/query-options.ts b/packages/shared/src/server/queries/clickhouse-sql/query-options.tsindex 6ff34697ec..aa020c3cc4 100644--- a/packages/shared/src/server/queries/clickhouse-sql/query-options.ts+++ b/packages/shared/src/server/queries/clickhouse-sql/query-options.ts@@ -33,3 +33,12 @@ export async function shouldSkipObservationsFinal(return false;}++/**+ * Whether the observations v2 public API should use the subquery-IN rewrite+ * instead of the CTE+JOIN split query. Temporary kill-switch; both paths+ * return identical result sets.+ */+export function shouldUseObservationsSubqueryRewrite(): boolean {+ return env.LANGFUSE_OBSERVATIONS_V2_SUBQUERY_REWRITE === "true";+}diff --git a/packages/shared/src/server/repositories/events.ts b/packages/shared/src/server/repositories/events.tsindex aaa8d0d6b0..8370cf48d3 100644--- a/packages/shared/src/server/repositories/events.ts+++ b/packages/shared/src/server/repositories/events.ts@@ -97,10 +97,12 @@ import {CTEQueryBuilder,EventsAggQueryBuilder,buildEventsFullTableSplitQuery,+ buildEventsFullTableSubqueryQuery,type QueryWithParams,type SessionEventsMetricsRow,OrderByEntry,} from "../queries/clickhouse-sql/event-query-builder";+import { shouldUseObservationsSubqueryRewrite } from "../queries/clickhouse-sql/query-options";import { type EventsObservationPublic } from "../queries/createGenerationsQuery";import {eventsTableCols,@@ -1360,6 +1362,7 @@ async function getObservationsRowsFromBuilder<T>(projectId: string,queryBuilder: QueryWithParams,operationName: string = "getObservationsFromEventsTableForPublicApi_rows",+ extraTags: Record<string, string> = {},): Promise<Array<T>> {const { query, params } = queryBuilder.buildWithParams();@@ -1373,6 +1376,7 @@ async function getObservationsRowsFromBuilder<T>(type: "events",kind: "publicApiRows",projectId,+ ...extraTags,},},fn: async (input) => {@@ -1501,38 +1505,72 @@ export const getObservationsV2FromEventsTableForPublicApi = async (options,);- baseBuilder.selectFieldSet("core");- const excludeFromBase = new Set<string>(["core", "io"]);- if (metadataFromFullTable) excludeFromBase.add("metadata");- requestedFields- .filter((fg) => !excludeFromBase.has(fg))- .forEach((fg) => baseBuilder.selectFieldSet(fg));-+ // Shared steps: ordering and pagination apply to every path and are+ // independent of which columns each path projects.applyOrderByForObservationsQuery(baseBuilder);applyCursorPagination(opts, baseBuilder);- let builder: QueryWithParams;+ // Pick the query shape. The rewrite only replaces the CTE+JOIN split query+ // (needsIOCTE); the simple path is untouched. External CTEs keep the+ // CTE+JOIN path: their resolution inside the IN subquery is unverified, and+ // no v2 filter currently produces one.+ const queryPath: "simple" | "cte-join" | "subquery-rewrite" = !needsIOCTE+ ? "simple"+ : externalCTEs.length === 0 && shouldUseObservationsSubqueryRewrite()+ ? "subquery-rewrite"+ : "cte-join";++ // Field groups projected on the base builder by the non-rewrite paths.+ // `io` (and `metadata` when it must come untruncated from events_full) is+ // fetched by the io CTE instead; selecting it on events_core would return+ // truncated values.+ const selectBaseFieldSets = () => {+ baseBuilder.selectFieldSet("core");+ const excludeFromBase = new Set<string>(["core", "io"]);+ if (metadataFromFullTable) excludeFromBase.add("metadata");+ requestedFields+ .filter((fg) => !excludeFromBase.has(fg))+ .forEach((fg) => baseBuilder.selectFieldSet(fg));+ };- if (!needsIOCTE) {- // Simple path: add CTEs back to the builder and use directly- for (const cte of externalCTEs) {- baseBuilder.withCTE(cte.name, cte.queryWithParams);- }- builder = baseBuilder;- } else {- builder = buildEventsFullTableSplitQuery({- projectId,- baseBuilder,- includeIO: needsIO,- includeMetadata: metadataFromFullTable,- externalCTEs,- }).orderByColumns(orderByForObservationsQuery("b", "id"));+ let builder: QueryWithParams;+ switch (queryPath) {+ case "simple":+ // Everything from events_core; CTEs attach directly to the builder.+ selectBaseFieldSets();+ for (const cte of externalCTEs) {+ baseBuilder.withCTE(cte.name, cte.queryWithParams);+ }+ builder = baseBuilder;+ break;+ case "cte-join":+ // Scalar groups from events_core, IO/metadata joined from events_full.+ selectBaseFieldSets();+ builder = buildEventsFullTableSplitQuery({+ projectId,+ baseBuilder,+ includeIO: needsIO,+ includeMetadata: metadataFromFullTable,+ externalCTEs,+ }).orderByColumns(orderByForObservationsQuery("b", "id"));+ break;+ case "subquery-rewrite":+ // No projection on the base builder: it becomes the inner IN-subquery,+ // which projects only the identity tuple (added by the build function).+ builder = buildEventsFullTableSubqueryQuery({+ projectId,+ innerBuilder: baseBuilder,+ fieldSetNames: ["core", ...requestedFields],+ });+ break;}const records =await getObservationsRowsFromBuilder<ObservationsTableQueryResultWitouhtTraceFields>(projectId,builder,+ undefined,+ { queryPath },);return await enrichObservationsWithModelData(diff --git a/web/src/__tests__/server/observations-api-v2.servertest.ts b/web/src/__tests__/server/observations-api-v2.servertest.tsindex 04757be0b7..dd8f0950b5 100644--- a/web/src/__tests__/server/observations-api-v2.servertest.ts+++ b/web/src/__tests__/server/observations-api-v2.servertest.ts@@ -11,6 +11,9 @@ import {import { GetObservationsV2Response } from "@/src/features/public-api/types/observations";import { randomUUID } from "crypto";import { env } from "@/src/env.mjs";+// Shared env: the subquery-rewrite kill-switch is read by shouldUseObservationsSubqueryRewrite()+// from the shared env object, not the web env above. Mutate this instance to toggle the flag.+import { env as sharedEnv } from "@langfuse/shared/src/env";import waitForExpect from "wait-for-expect";let projectId: string;@@ -1740,4 +1743,257 @@ describe("/api/public/v2/observations API Endpoint", () => {);});});++ // Exercises the needsIOCTE branch (the only path the rewrite replaces)+ // under both flag values: results must match the CTE path byte-identically+ // and keep the canonical ORDER BY.+ maybe("subquery rewrite", () => {+ const originalFlag = sharedEnv.LANGFUSE_OBSERVATIONS_V2_SUBQUERY_REWRITE;++ const setRewrite = (value: "true" | "false") => {+ (+ sharedEnv as { LANGFUSE_OBSERVATIONS_V2_SUBQUERY_REWRITE: string }+ ).LANGFUSE_OBSERVATIONS_V2_SUBQUERY_REWRITE = value;+ };++ afterEach(() => {+ setRewrite(originalFlag);+ });++ const seedRichObservations = async (traceId: string, count: number) => {+ const base = Date.now() * 1000;+ const seeded = [] as Array<{ id: string; startMicros: number }>;+ const events = Array.from({ length: count }, (_, i) => {+ const obsId = randomUUID();+ const startMicros = base + i * 1000 * 1000; // 1s apart, distinct order+ seeded.push({ id: obsId, startMicros });+ return createEvent({+ id: obsId,+ span_id: obsId,+ trace_id: traceId,+ project_id: projectId,+ name: `rewrite-obs-${i}`,+ type: "GENERATION",+ level: "DEFAULT",+ start_time: startMicros,+ end_time: startMicros + 500 * 1000,+ input: `input-${i}-${"x".repeat(300)}`, // > events_core truncation+ output: `output-${i}-${"y".repeat(300)}`,+ metadata: { source: "api", idx: String(i) },+ metadata_names: ["source", "idx"],+ metadata_values: ["api", String(i)],+ provided_model_name: "gpt-4",+ });+ });+ await createEventsCh(events);+ return seeded;+ };++ it("returns identical results to the CTE path across field-group combos", async () => {+ const traceId = randomUUID();+ await seedRichObservations(traceId, 5);++ // Each combo includes `io` (or expandMetadata) so the needsIOCTE branch —+ // the only path the rewrite touches — is exercised.+ const urls = [+ `/api/public/v2/observations?traceId=${traceId}&fields=core,basic,io`,+ `/api/public/v2/observations?traceId=${traceId}&fields=core,basic,model,usage,io,metadata`,+ `/api/public/v2/observations?traceId=${traceId}&fields=io,metadata`,+ `/api/public/v2/observations?traceId=${traceId}&fields=metadata&expandMetadata=source,idx`,+ ];++ for (const url of urls) {+ setRewrite("false");+ const ctePath = await getObservations(url);+ setRewrite("true");+ const subqueryPath = await getObservations(url);++ expect(subqueryPath.status).toBe(200);+ expect(ctePath.status).toBe(200);+ expect(subqueryPath.body.data.length).toBe(5);+ // Byte-identical rows (same values, same order) between both code paths.+ expect(subqueryPath.body.data).toEqual(ctePath.body.data);+ }+ });++ it("applies the canonical ORDER BY under the subquery path", async () => {+ const traceId = randomUUID();+ const base = Date.now() * 1000;++ // Two observations share a start_time to exercise the span_id tiebreak.+ const sharedStart = base + 1000 * 1000;+ const specs = [+ { id: randomUUID(), startMicros: base + 3 * 1000 * 1000 },+ { id: randomUUID(), startMicros: sharedStart },+ { id: randomUUID(), startMicros: sharedStart },+ { id: randomUUID(), startMicros: base },+ ];+ await createEventsCh(+ specs.map((s, i) =>+ createEvent({+ id: s.id,+ span_id: s.id,+ trace_id: traceId,+ project_id: projectId,+ name: `order-obs-${i}`,+ type: "GENERATION",+ level: "DEFAULT",+ start_time: s.startMicros,+ input: `io-${i}`,+ output: `io-${i}`,+ }),+ ),+ );++ // Canonical order within a single trace (xxHash32(trace_id) constant):+ // start_time DESC, then span_id DESC.+ const expectedIds = [...specs]+ .sort((a, b) =>+ b.startMicros !== a.startMicros+ ? b.startMicros - a.startMicros+ : a.id < b.id+ ? 1+ : a.id > b.id+ ? -1+ : 0,+ )+ .map((s) => s.id);++ setRewrite("true");+ const response = await getObservations(+ `/api/public/v2/observations?traceId=${traceId}&fields=io&limit=50`,+ );++ expect(response.status).toBe(200);+ expect(response.body.data.map((o: { id: string }) => o.id)).toEqual(+ expectedIds,+ );+ });++ it("returns identical results to the CTE path for trace-level (userId) filters", async () => {+ // userId is a trace-level field denormalized onto events_*, so it+ // filters inside the IN subquery without an external traces CTE.+ const traceId = randomUUID();+ const userId = `rewrite-user-${randomUUID()}`;+ const base = Date.now() * 1000;++ await createEventsCh(+ Array.from({ length: 4 }, (_, i) => {+ const obsId = randomUUID();+ return createEvent({+ id: obsId,+ span_id: obsId,+ trace_id: traceId,+ project_id: projectId,+ user_id: i < 2 ? userId : `other-user-${i}`,+ name: `user-filter-obs-${i}`,+ type: "GENERATION",+ level: "DEFAULT",+ start_time: base + i * 1000 * 1000,+ input: `input-${i}-${"x".repeat(300)}`, // > events_core truncation+ output: `output-${i}-${"y".repeat(300)}`,+ });+ }),+ );++ const url = `/api/public/v2/observations?traceId=${traceId}&userId=${userId}&fields=core,basic,io`;++ setRewrite("false");+ const ctePath = await getObservations(url);+ setRewrite("true");+ const subqueryPath = await getObservations(url);++ expect(ctePath.status).toBe(200);+ expect(subqueryPath.status).toBe(200);+ expect(subqueryPath.body.data.length).toBe(2);+ expect(subqueryPath.body.data).toEqual(ctePath.body.data);+ });++ it("paginates without skips or duplicates under the subquery path", async () => {+ const traceId = randomUUID();+ const seeded = await seedRichObservations(traceId, 5);+ const expectedIds = [...seeded]+ .sort((a, b) => b.startMicros - a.startMicros)+ .map((s) => s.id);++ setRewrite("true");+ const collected: string[] = [];+ let cursor: string | undefined;+ for (let page = 0; page < 4; page++) {+ const response = await getObservations(+ `/api/public/v2/observations?traceId=${traceId}&fields=io&limit=2` ++ (cursor ? `&cursor=${cursor}` : ""),+ );+ expect(response.status).toBe(200);+ collected.push(...response.body.data.map((o: { id: string }) => o.id));+ cursor = response.body.meta.cursor ?? undefined;+ if (!cursor) break;+ }++ // Every seeded row exactly once, in canonical order across pages.+ expect(collected).toEqual(expectedIds);+ });++ it("returns identical results to the CTE path for FTS filters (forceFullTable)", async () => {+ // A `matches` filter on output is an FTS filter, which escalates the+ // inner query from events_core to events_full.+ const traceId = randomUUID();+ const base = Date.now() * 1000;+ const matching = [randomUUID(), randomUUID()];++ await createEventsCh(+ Array.from({ length: 5 }, (_, i) => {+ const obsId = i < 2 ? matching[i] : randomUUID();+ return createEvent({+ id: obsId,+ span_id: obsId,+ trace_id: traceId,+ project_id: projectId,+ name: `fts-obs-${i}`,+ type: "GENERATION",+ level: "DEFAULT",+ start_time: base + i * 1000 * 1000,+ input: `input-${i}-${"x".repeat(300)}`,+ output:+ i < 2+ ? `needle result ${i} ${"y".repeat(300)}`+ : `plain result ${i} ${"y".repeat(300)}`,+ });+ }),+ );++ const filterParam = JSON.stringify([+ {+ type: "string",+ column: "output",+ operator: "matches",+ value: "needle",+ },+ ]);+ const url = `/api/public/v2/observations?traceId=${traceId}&fields=core,basic,io&filter=${encodeURIComponent(filterParam)}`;++ setRewrite("false");+ const ctePath = await getObservations(url);+ setRewrite("true");+ const subqueryPath = await getObservations(url);++ expect(ctePath.status).toBe(200);+ expect(subqueryPath.status).toBe(200);+ expect(+ subqueryPath.body.data.map((o: { id: string }) => o.id).sort(),+ ).toEqual([...matching].sort());+ expect(subqueryPath.body.data).toEqual(ctePath.body.data);+ });++ it("returns an empty page under the subquery path", async () => {+ setRewrite("true");+ const response = await getObservations(+ `/api/public/v2/observations?traceId=${randomUUID()}&fields=io`,+ );++ expect(response.status).toBe(200);+ expect(response.body.data).toEqual([]);+ expect(response.body.meta.cursor).toBeUndefined();+ });+ });});diff --git a/web/src/env.mjs b/web/src/env.mjsindex 789ca5576f..b388644a3b 100644--- a/web/src/env.mjs+++ b/web/src/env.mjs@@ -441,6 +441,11 @@ export const env = createEnv({.enum(["legacy", "dual", "events_only"]).default("legacy"),+ // Temporary kill-switch for the observations v2 subquery-IN rewrite.+ LANGFUSE_OBSERVATIONS_V2_SUBQUERY_REWRITE: z+ .enum(["true", "false"])+ .default("false"),+// Blocked users for chat completion API (userId:reason format)LANGFUSE_BLOCKED_USERIDS_CHATCOMPLETION: z.string()@@ -851,6 +856,8 @@ export const env = createEnv({// Legacy tracing search controlsLANGFUSE_DISABLE_LEGACY_TRACING_IO_SEARCH:process.env.LANGFUSE_DISABLE_LEGACY_TRACING_IO_SEARCH,+ LANGFUSE_OBSERVATIONS_V2_SUBQUERY_REWRITE:+ process.env.LANGFUSE_OBSERVATIONS_V2_SUBQUERY_REWRITE,LANGFUSE_BLOCKED_USERIDS_CHATCOMPLETION:process.env.LANGFUSE_BLOCKED_USERIDS_CHATCOMPLETION,},