feat(api): update API spec from langfuse/langfuse f5e96a9 #1408
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Important
This pull request adds OpenTelemetry support to the API, introducing new models and clients for handling OpenTelemetry traces and updating existing clients to integrate this functionality.
OtelAttribute,OtelAttributeValue,OtelResource,OtelResourceSpan,OtelScope,OtelScopeSpan,OtelSpan,OtelTraceResponsemodels inopentelemetry/types.OpentelemetryClientandAsyncOpentelemetryClientinopentelemetry/client.pyfor trace ingestion.client.pyto includeOpentelemetryClientandAsyncOpentelemetryClient.export_traces()method to handle OpenTelemetry trace ingestion.reference.mdto document new OpenTelemetry endpoint/api/public/otel/v1/traces.observations/client.pyto include afilterparameter inget_many()method.ingestion/client.pyto deprecate batch ingestion in favor of OpenTelemetry.This description was created by
for b9107ab. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Overview
Updated On: 2025-10-17 14:35:44 UTC
Summary
This PR updates the auto-generated API client code from the main Langfuse repository, introducing three main additions:
New OpenTelemetry Trace Export API: Adds a complete implementation of the OTLP/HTTP specification for trace ingestion (
/api/public/otel/v1/tracesendpoint) with support for both JSON and binary Protobuf formats, including all necessary types (OtelSpan,OtelResource,OtelScope,OtelAttribute, etc.)Enhanced Observations Filtering: Adds an advanced
filterparameter to the observations API that supports complex filter conditions with various operators and data types, providing more flexible querying capabilitiesPrompt Type Classification: Adds a
typefield toPromptMetato distinguish between chat and text promptsAll changes are auto-generated from the API specification and follow established patterns in the codebase. The OpenTelemetry integration aligns with the SDK's existing OTel-based architecture mentioned in
CLAUDE.md.Confidence Score: 5/5
Important Files Changed
File Analysis
Sequence Diagram
sequenceDiagram participant Client as Langfuse Client participant API as FernLangfuse API participant OTel as OpenTelemetry Client participant Obs as Observations Client participant Prompts as Prompts Client Note over Client,Prompts: New OpenTelemetry Integration Client->>API: Initialize with credentials API->>OTel: Create opentelemetry client Client->>OTel: export_traces(resource_spans) OTel->>OTel: POST /api/public/otel/v1/traces OTel-->>Client: OtelTraceResponse Note over Client,Prompts: Enhanced Observations Filtering Client->>API: Initialize client API->>Obs: Create observations client Client->>Obs: get(filter=json_string) Obs->>Obs: Apply complex filter conditions Obs-->>Client: ObservationsViews Note over Client,Prompts: Prompt Type Classification Client->>API: Initialize client API->>Prompts: Create prompts client Client->>Prompts: get_prompts() Prompts-->>Client: PromptMeta (with type field)