Skip to content

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

fix(blobstorage): hide no-op trace_context group and single-option export source selector (#14833)

Niklas Semmler751c4b8d3d0e
diff --git a/packages/shared/src/features/analytics-integrations/index.ts b/packages/shared/src/features/analytics-integrations/index.ts
index 11d1630b63..0c4564bd55 100644
--- a/packages/shared/src/features/analytics-integrations/index.ts
+++ b/packages/shared/src/features/analytics-integrations/index.ts
@@ -144,5 +144,8 @@ export const EXPORT_FIELD_GROUP_OPTIONS = OBSERVATION_FIELD_GROUPS_FULL.map(
legacyDescription: legacyDescriptionForGroup(value),
parquetDescription: parquetDescriptionForGroup(value),
legacyParquetDescription: legacyParquetDescriptionForGroup(value),
+ // Groups without legacy columns (trace_context) are a no-op for
+ // legacy-only exports; the UI hides them for that source.
+ includedInLegacyExport: legacyFieldsForGroup(value).length > 0,
}),
);
diff --git a/web/src/__tests__/blob-storage-form-field-groups.clienttest.ts b/web/src/__tests__/blob-storage-form-field-groups.clienttest.ts
index 35de47fea7..8fae9a6431 100644
--- a/web/src/__tests__/blob-storage-form-field-groups.clienttest.ts
+++ b/web/src/__tests__/blob-storage-form-field-groups.clienttest.ts
@@ -150,4 +150,12 @@ describe("EXPORT_FIELD_GROUP_OPTIONS — parquet description", () => {
"Not included in the legacy observations export",
);
});
+
+ it("flags groups without legacy observation columns so the UI can hide them for legacy-only exports", () => {
+ for (const option of EXPORT_FIELD_GROUP_OPTIONS) {
+ expect(option.includedInLegacyExport).toBe(
+ option.value !== "trace_context",
+ );
+ }
+ });
});
diff --git a/web/src/features/blobstorage-integration/exportSource.clienttest.ts b/web/src/features/blobstorage-integration/exportSource.clienttest.ts
index a575922f14..b892b232b2 100644
--- a/web/src/features/blobstorage-integration/exportSource.clienttest.ts
+++ b/web/src/features/blobstorage-integration/exportSource.clienttest.ts
@@ -4,6 +4,7 @@ import {
getExportSourceFormValue,
getExportSourceOptions,
isExportSourceSelectable,
+ shouldHideExportSourceSelector,
} from "./exportSource";
const cloudPreCutoff = {
@@ -177,3 +178,52 @@ describe("getExportSourceOptions", () => {
).toBe(false);
});
});
+
+describe("shouldHideExportSourceSelector", () => {
+ it("hides the selector when there is exactly one selectable source", () => {
+ // Post-cutoff Cloud project: EVENTS only.
+ expect(
+ shouldHideExportSourceSelector(
+ getExportSourceOptions(undefined, cloudPostCutoff),
+ ),
+ ).toBe(true);
+ // Rolled-back self-hosted with a persisted legacy source: legacy only.
+ expect(
+ shouldHideExportSourceSelector(
+ getExportSourceOptions(
+ AnalyticsIntegrationExportSource.TRACES_OBSERVATIONS,
+ selfHostedRolledBack,
+ ),
+ ),
+ ).toBe(true);
+ });
+
+ it("keeps the selector when there is a real choice", () => {
+ expect(
+ shouldHideExportSourceSelector(
+ getExportSourceOptions(undefined, cloudPreCutoff),
+ ),
+ ).toBe(false);
+ // Stale persisted enriched source alongside the legacy fallback.
+ expect(
+ shouldHideExportSourceSelector(
+ getExportSourceOptions(
+ AnalyticsIntegrationExportSource.EVENTS,
+ selfHostedRolledBack,
+ ),
+ ),
+ ).toBe(false);
+ });
+
+ it("keeps the selector when the sole option is the stale persisted source", () => {
+ // The unavailable-source alert points at the selector; hiding it here
+ // would strand the user with a blocked save and nothing to change.
+ const options = getExportSourceOptions(
+ AnalyticsIntegrationExportSource.EVENTS,
+ { eventsExportAvailable: false, forceEventsExport: true },
+ );
+ expect(options).toHaveLength(1);
+ expect(options[0].unavailable).toBe(true);
+ expect(shouldHideExportSourceSelector(options)).toBe(false);
+ });
+});
diff --git a/web/src/features/blobstorage-integration/exportSource.ts b/web/src/features/blobstorage-integration/exportSource.ts
index b4aece2fec..8d29682bb4 100644
--- a/web/src/features/blobstorage-integration/exportSource.ts
+++ b/web/src/features/blobstorage-integration/exportSource.ts
@@ -41,6 +41,16 @@ export type SelectableExportSourceOption = ExportSourceOption & {
unavailable: boolean;
};
+// A single selectable option carries no decision, so the selector is hidden
+// (post-cutoff Cloud projects never see it). When the sole option is the
+// stale persisted source, keep the selector: the unavailable-source alert
+// refers to it and hiding it would strand the user with a blocked save.
+export function shouldHideExportSourceSelector(
+ options: SelectableExportSourceOption[],
+): boolean {
+ return options.length === 1 && !options[0].unavailable;
+}
+
// Selectable sources, plus the persisted one (marked unavailable) when it is
// no longer selectable, so the conflict is visible rather than silently rewritten.
export function getExportSourceOptions(
diff --git a/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx b/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx
index 0baf3bc558..9d5d4fde83 100644
--- a/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx
+++ b/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx
@@ -63,6 +63,7 @@ import {
getExportSourceFormValue,
getExportSourceOptions,
isExportSourceSelectable,
+ shouldHideExportSourceSelector,
} from "@/src/features/blobstorage-integration/exportSource";
import { useLangfuseCloudRegion } from "@/src/features/organizations/hooks";
import { useQueryProject } from "@/src/features/projects/hooks";
@@ -387,7 +388,10 @@ const BlobStorageIntegrationSettingsForm = ({
state?.exportSource,
availability,
);
- // Visible but locked when there is only one selectable option.
+ // No decision to make → no selector. Only the degenerate single-option
+ // state (stale persisted source) stays visible, locked, so the
+ // unavailable-source alert below has something to refer to.
+ const hideExportSource = shouldHideExportSourceSelector(exportSourceOptions);
const exportSourceLocked = exportSourceOptions.length === 1;
const exportSourceUnavailable =
watchedExportSource != null &&
@@ -778,75 +782,77 @@ const BlobStorageIntegrationSettingsForm = ({
)}
/>
- <FormField
- control={blobStorageForm.control}
- name="exportSource"
- render={({ field }) => (
- <FormItem>
- <FormLabel className="flex items-center gap-1.5 pt-2">
- Export Source
- <Tooltip>
- <TooltipTrigger>
- <Info className="text-muted-foreground h-3.5 w-3.5" />
- </TooltipTrigger>
- <TooltipContent
- side="bottom"
- className="max-w-[350px] space-y-2 p-3"
- >
- {exportSourceOptions.map((option) => (
- <div key={option.value} className="space-y-0.5">
- <div className="font-medium">{option.label}</div>
- <div className="text-muted-foreground text-xs">
- {option.description}
+ {!hideExportSource && (
+ <FormField
+ control={blobStorageForm.control}
+ name="exportSource"
+ render={({ field }) => (
+ <FormItem>
+ <FormLabel className="flex items-center gap-1.5 pt-2">
+ Export Source
+ <Tooltip>
+ <TooltipTrigger>
+ <Info className="text-muted-foreground h-3.5 w-3.5" />
+ </TooltipTrigger>
+ <TooltipContent
+ side="bottom"
+ className="max-w-[350px] space-y-2 p-3"
+ >
+ {exportSourceOptions.map((option) => (
+ <div key={option.value} className="space-y-0.5">
+ <div className="font-medium">{option.label}</div>
+ <div className="text-muted-foreground text-xs">
+ {option.description}
+ </div>
</div>
+ ))}
+ <div className="border-t pt-2">
+ <a
+ href="https://langfuse.com/docs/integrations/export-sources"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="text-muted-foreground hover:text-primary inline-flex items-center gap-1 text-xs hover:underline"
+ >
+ For further information see
+ <ExternalLink className="h-3 w-3" />
+ </a>
</div>
- ))}
- <div className="border-t pt-2">
- <a
- href="https://langfuse.com/docs/integrations/export-sources"
- target="_blank"
- rel="noopener noreferrer"
- className="text-muted-foreground hover:text-primary inline-flex items-center gap-1 text-xs hover:underline"
+ </TooltipContent>
+ </Tooltip>
+ </FormLabel>
+ <Select
+ onValueChange={field.onChange}
+ value={field.value}
+ disabled={exportSourceLocked}
+ >
+ <FormControl>
+ <SelectTrigger>
+ <SelectValue placeholder="Select data to export" />
+ </SelectTrigger>
+ </FormControl>
+ <SelectContent>
+ {exportSourceOptions.map((option) => (
+ <SelectItem
+ key={option.value}
+ value={option.value}
+ disabled={option.unavailable}
>
- For further information see
- <ExternalLink className="h-3 w-3" />
- </a>
- </div>
- </TooltipContent>
- </Tooltip>
- </FormLabel>
- <Select
- onValueChange={field.onChange}
- value={field.value}
- disabled={exportSourceLocked}
- >
- <FormControl>
- <SelectTrigger>
- <SelectValue placeholder="Select data to export" />
- </SelectTrigger>
- </FormControl>
- <SelectContent>
- {exportSourceOptions.map((option) => (
- <SelectItem
- key={option.value}
- value={option.value}
- disabled={option.unavailable}
- >
- {option.unavailable
- ? `${option.label} (not available on this deployment)`
- : option.label}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- <FormDescription>
- Choose which data sources to export to blob storage. Scores are
- always included.
- </FormDescription>
- <FormMessage />
- </FormItem>
- )}
- />
+ {option.unavailable
+ ? `${option.label} (not available on this deployment)`
+ : option.label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ <FormDescription>
+ Choose which data sources to export to blob storage. Scores
+ are always included.
+ </FormDescription>
+ <FormMessage />
+ </FormItem>
+ )}
+ />
+ )}
{exportSourceUnavailable && (
<Alert variant="destructive">
@@ -875,11 +881,19 @@ const BlobStorageIntegrationSettingsForm = ({
size, or privacy-sensitive groups (e.g. Metadata) to avoid
storing user data.
{includesLegacyExport
- ? " Traces and scores are always exported in full. Fields that only exist on the enriched observations (e.g. Trace Context) are omitted from the legacy observations export."
+ ? isLegacyOnlyExport
+ ? " Traces and scores are always exported in full. Field groups that only exist on the enriched observations (e.g. Trace Context) are not available for this export source."
+ : " Traces and scores are always exported in full. Fields that only exist on the enriched observations (e.g. Trace Context) are omitted from the legacy observations export."
: " Scores are always exported in full."}
</FormDescription>
<div className="mt-2 space-y-2">
- {EXPORT_FIELD_GROUP_OPTIONS.map((option) => {
+ {EXPORT_FIELD_GROUP_OPTIONS.filter(
+ // Hide no-op groups (no legacy columns) for legacy-only
+ // exports; a saved selection is kept and applies again if
+ // the source is migrated to enriched observations.
+ (option) =>
+ !isLegacyOnlyExport || option.includedInLegacyExport,
+ ).map((option) => {
const isCore = option.value === "core";
return (
<div key={option.value} className="flex items-start gap-2">