Skip to content

Commit 61b3282

Browse files
feat(api): add score metadata and provenance blob export field groups (#2048)
Takes only the blob storage integration files from the generated API client update; the remaining spec changes ship separately. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent ab861f1 commit 61b3282

5 files changed

Lines changed: 17 additions & 7 deletions

File tree

‎langfuse/api/blob_storage_integrations/client.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def upsert_blob_storage_integration(
159159
**Cloud-only integration deprecation gate (effective 2026-06-22):** On Langfuse Cloud, legacy export sources are only accepted for blob storage integrations created before 2026-06-22, regardless of project age. Requests that would create a new integration with `LEGACY_TRACES_OBSERVATIONS` or `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS` are rejected with HTTP 400. Use `OBSERVATIONS_V2` instead. Self-hosted deployments are unaffected.
160160
161161
export_field_groups : typing.Optional[typing.Sequence[BlobStorageExportFieldGroup]]
162-
Field groups to include in each exported observation row. Applies to all export sources; must include `core` if provided. When omitted on create, the column default (all groups) applies. When omitted on update, the existing value is preserved.
162+
Field groups to include in each exported observation and score row. Applies to all export sources; must include the observation `core` group if provided. Core score columns are always exported; score groups add columns on top. When omitted on create, all observation groups are selected and no score groups. When omitted on update, the existing value is preserved.
163163
164164
`exportFieldGroups` requires `exportSource` to be provided in the same request.
165165
@@ -438,7 +438,7 @@ async def upsert_blob_storage_integration(
438438
**Cloud-only integration deprecation gate (effective 2026-06-22):** On Langfuse Cloud, legacy export sources are only accepted for blob storage integrations created before 2026-06-22, regardless of project age. Requests that would create a new integration with `LEGACY_TRACES_OBSERVATIONS` or `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS` are rejected with HTTP 400. Use `OBSERVATIONS_V2` instead. Self-hosted deployments are unaffected.
439439
440440
export_field_groups : typing.Optional[typing.Sequence[BlobStorageExportFieldGroup]]
441-
Field groups to include in each exported observation row. Applies to all export sources; must include `core` if provided. When omitted on create, the column default (all groups) applies. When omitted on update, the existing value is preserved.
441+
Field groups to include in each exported observation and score row. Applies to all export sources; must include the observation `core` group if provided. Core score columns are always exported; score groups add columns on top. When omitted on create, all observation groups are selected and no score groups. When omitted on update, the existing value is preserved.
442442
443443
`exportFieldGroups` requires `exportSource` to be provided in the same request.
444444

‎langfuse/api/blob_storage_integrations/raw_client.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def upsert_blob_storage_integration(
216216
**Cloud-only integration deprecation gate (effective 2026-06-22):** On Langfuse Cloud, legacy export sources are only accepted for blob storage integrations created before 2026-06-22, regardless of project age. Requests that would create a new integration with `LEGACY_TRACES_OBSERVATIONS` or `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS` are rejected with HTTP 400. Use `OBSERVATIONS_V2` instead. Self-hosted deployments are unaffected.
217217
218218
export_field_groups : typing.Optional[typing.Sequence[BlobStorageExportFieldGroup]]
219-
Field groups to include in each exported observation row. Applies to all export sources; must include `core` if provided. When omitted on create, the column default (all groups) applies. When omitted on update, the existing value is preserved.
219+
Field groups to include in each exported observation and score row. Applies to all export sources; must include the observation `core` group if provided. Core score columns are always exported; score groups add columns on top. When omitted on create, all observation groups are selected and no score groups. When omitted on update, the existing value is preserved.
220220
221221
`exportFieldGroups` requires `exportSource` to be provided in the same request.
222222
@@ -713,7 +713,7 @@ async def upsert_blob_storage_integration(
713713
**Cloud-only integration deprecation gate (effective 2026-06-22):** On Langfuse Cloud, legacy export sources are only accepted for blob storage integrations created before 2026-06-22, regardless of project age. Requests that would create a new integration with `LEGACY_TRACES_OBSERVATIONS` or `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS` are rejected with HTTP 400. Use `OBSERVATIONS_V2` instead. Self-hosted deployments are unaffected.
714714
715715
export_field_groups : typing.Optional[typing.Sequence[BlobStorageExportFieldGroup]]
716-
Field groups to include in each exported observation row. Applies to all export sources; must include `core` if provided. When omitted on create, the column default (all groups) applies. When omitted on update, the existing value is preserved.
716+
Field groups to include in each exported observation and score row. Applies to all export sources; must include the observation `core` group if provided. Core score columns are always exported; score groups add columns on top. When omitted on create, all observation groups are selected and no score groups. When omitted on update, the existing value is preserved.
717717
718718
`exportFieldGroups` requires `exportSource` to be provided in the same request.
719719

‎langfuse/api/blob_storage_integrations/types/blob_storage_export_field_group.py‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
class BlobStorageExportFieldGroup(enum.StrEnum):
1111
"""
12-
Field group selecting which observation columns are included in the export. Applies to all export sources; groups without a counterpart in the legacy data model (e.g. `trace_context`) are omitted from the legacy observations export.
12+
Field group selecting which columns are included in the export. Applies to all export sources.
13+
- Observation groups (`core` through `trace_context`) select observation columns; groups without a counterpart in the legacy data model (e.g. `trace_context`) are omitted from the legacy observations export.
14+
- Score groups (`score_` prefix) add optional columns to the scores export. The core score columns (`id`, `timestamp`, `trace_id`, `name`, `value`, …) are always exported and are not a selectable group; score groups add columns on top of them. `score_metadata` adds the score `metadata` column. `score_provenance` adds the references to where a score came from: `author_user_id`, `config_id`, `queue_id`, `evaluator_id`, `evaluation_rule_id`, `execution_trace_id`. Score groups are never selected by default.
1315
"""
1416

1517
CORE = "core"
@@ -23,6 +25,8 @@ class BlobStorageExportFieldGroup(enum.StrEnum):
2325
METRICS = "metrics"
2426
TOOLS = "tools"
2527
TRACE_CONTEXT = "trace_context"
28+
SCORE_METADATA = "score_metadata"
29+
SCORE_PROVENANCE = "score_provenance"
2630

2731
def visit(
2832
self,
@@ -37,6 +41,8 @@ def visit(
3741
metrics: typing.Callable[[], T_Result],
3842
tools: typing.Callable[[], T_Result],
3943
trace_context: typing.Callable[[], T_Result],
44+
score_metadata: typing.Callable[[], T_Result],
45+
score_provenance: typing.Callable[[], T_Result],
4046
) -> T_Result:
4147
if self is BlobStorageExportFieldGroup.CORE:
4248
return core()
@@ -60,3 +66,7 @@ def visit(
6066
return tools()
6167
if self is BlobStorageExportFieldGroup.TRACE_CONTEXT:
6268
return trace_context()
69+
if self is BlobStorageExportFieldGroup.SCORE_METADATA:
70+
return score_metadata()
71+
if self is BlobStorageExportFieldGroup.SCORE_PROVENANCE:
72+
return score_provenance()

‎langfuse/api/blob_storage_integrations/types/blob_storage_integration_response.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class BlobStorageIntegrationResponse(UniversalBaseModel):
5353
FieldMetadata(alias="exportFieldGroups"),
5454
] = pydantic.Field(default=None)
5555
"""
56-
Field groups included in each exported observation row. An empty list is treated as all groups during export.
56+
Field groups included in each exported observation and score row. An empty list is treated as all observation groups and no score groups during export. Core score columns are always exported.
5757
"""
5858

5959
next_sync_at: typing_extensions.Annotated[

‎langfuse/api/blob_storage_integrations/types/create_blob_storage_integration_request.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class CreateBlobStorageIntegrationRequest(UniversalBaseModel):
111111
FieldMetadata(alias="exportFieldGroups"),
112112
] = pydantic.Field(default=None)
113113
"""
114-
Field groups to include in each exported observation row. Applies to all export sources; must include `core` if provided. When omitted on create, the column default (all groups) applies. When omitted on update, the existing value is preserved.
114+
Field groups to include in each exported observation and score row. Applies to all export sources; must include the observation `core` group if provided. Core score columns are always exported; score groups add columns on top. When omitted on create, all observation groups are selected and no score groups. When omitted on update, the existing value is preserved.
115115
116116
`exportFieldGroups` requires `exportSource` to be provided in the same request.
117117
"""

0 commit comments

Comments
 (0)