Skip to content

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

docs(api): add docs to api reference for /ingestion route (#2311)

Marc Klingenba3e6eec47b0
diff --git a/fern/apis/server/definition/ingestion.yml b/fern/apis/server/definition/ingestion.yml
index 313486b657..81d920494e 100644
--- a/fern/apis/server/definition/ingestion.yml
+++ b/fern/apis/server/definition/ingestion.yml
@@ -7,28 +7,52 @@ service:
base-path: /api/public
endpoints:
batch:
- docs: Batched ingestion for Langfuse Tracing
+ docs: Batched ingestion for Langfuse Tracing. If you want to use tracing via the API, such as to build your own Langfuse client implementation, this is the only API route you need to implement.
method: POST
path: /ingestion
request:
name: IngestionRequest
body:
properties:
- batch: list<IngestionEvent>
- response: IngestionResponse # will be reportet as 200 response, but endpoint returns 207
+ batch:
+ type: list<IngestionEvent>
+ docs: "Batch of tracing events to be ingested. Discriminated by attribute `type`."
+ metadata:
+ type: optional<unknown>
+ docs: Optional. Metadata field used by the Langfuse SDKs for debugging.
+ response:
+ type: IngestionResponse
+ status-code: 207
types:
IngestionEvent:
discriminant: "type"
union:
- trace-create: TraceEvent
- score-create: ScoreEvent
- event-create: CreateEventEvent
- generation-create: CreateGenerationEvent
- generation-update: UpdateGenerationEvent
- span-create: CreateSpanEvent
- span-update: UpdateSpanEvent
- sdk-log: SDKLogEvent
+ trace-create:
+ type: TraceEvent
+ docs: Creates a new trace. Upserts on id for updates if trace with id exists.
+ score-create:
+ type: ScoreEvent
+ docs: Creates a new score. Upserts on id for updates if score with id exists.
+ span-create:
+ type: CreateSpanEvent
+ docs: Creates a new span.
+ span-update:
+ type: UpdateSpanEvent
+ docs: Updates span based on id.
+ generation-create:
+ type: CreateGenerationEvent
+ docs: Creates a new generation.
+ generation-update:
+ type: UpdateGenerationEvent
+ docs: Updates a generation based on id.
+ event-create:
+ type: CreateEventEvent
+ docs: Creates an event.
+
+ sdk-log:
+ type: SDKLogEvent
+ docs: Langfuse SDKs only, used for debugging purposes.
# both are legacy
observation-create:
@@ -162,9 +186,15 @@ types:
BaseEvent:
properties:
- id: string
- timestamp: string
- metadata: unknown
+ id:
+ type: string
+ docs: UUID v4 that identifies the event
+ timestamp:
+ type: string
+ docs: "Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal)."
+ metadata:
+ type: optional<unknown>
+ docs: Optional. Metadata field used by the Langfuse SDKs for debugging.
TraceEvent:
extends: BaseEvent
diff --git a/fern/fern.config.json b/fern/fern.config.json
index 123a7f31a2..b1795fc26f 100644
--- a/fern/fern.config.json
+++ b/fern/fern.config.json
@@ -1,4 +1,4 @@
{
"organization": "finto",
- "version": "0.21.0"
+ "version": "0.30.3"
}
\ No newline at end of file
diff --git a/web/public/generated/api/openapi.yml b/web/public/generated/api/openapi.yml
index 3c6ee63fb2..8f530cb86c 100644
--- a/web/public/generated/api/openapi.yml
+++ b/web/public/generated/api/openapi.yml
@@ -397,7 +397,10 @@ paths:
description: ''
/api/public/ingestion:
post:
- description: Batched ingestion for Langfuse Tracing
+ description: >-
+ Batched ingestion for Langfuse Tracing. If you want to use tracing via
+ the API, such as to build your own Langfuse client implementation, this
+ is the only API route you need to implement.
operationId: ingestion_batch
tags:
- Ingestion
@@ -446,6 +449,14 @@ paths:
type: array
items:
$ref: '#/components/schemas/IngestionEvent'
+ description: >-
+ Batch of tracing events to be ingested. Discriminated by
+ attribute `type`.
+ metadata:
+ nullable: true
+ description: >-
+ Optional. Metadata field used by the Langfuse SDKs for
+ debugging.
required:
- batch
/api/public/metrics/daily:
@@ -1972,8 +1983,8 @@ components:
type:
type: string
enum:
- - event-create
- - $ref: '#/components/schemas/CreateEventEvent'
+ - span-create
+ - $ref: '#/components/schemas/CreateSpanEvent'
required:
- type
- type: object
@@ -1983,8 +1994,8 @@ components:
type:
type: string
enum:
- - generation-create
- - $ref: '#/components/schemas/CreateGenerationEvent'
+ - span-update
+ - $ref: '#/components/schemas/UpdateSpanEvent'
required:
- type
- type: object
@@ -1994,8 +2005,8 @@ components:
type:
type: string
enum:
- - generation-update
- - $ref: '#/components/schemas/UpdateGenerationEvent'
+ - generation-create
+ - $ref: '#/components/schemas/CreateGenerationEvent'
required:
- type
- type: object
@@ -2005,8 +2016,8 @@ components:
type:
type: string
enum:
- - span-create
- - $ref: '#/components/schemas/CreateSpanEvent'
+ - generation-update
+ - $ref: '#/components/schemas/UpdateGenerationEvent'
required:
- type
- type: object
@@ -2016,8 +2027,8 @@ components:
type:
type: string
enum:
- - span-update
- - $ref: '#/components/schemas/UpdateSpanEvent'
+ - event-create
+ - $ref: '#/components/schemas/CreateEventEvent'
required:
- type
- type: object
@@ -2340,13 +2351,20 @@ components:
properties:
id:
type: string
+ description: UUID v4 that identifies the event
timestamp:
type: string
- metadata: {}
+ description: >-
+ Datetime (ISO 8601) of event creation in client. Should be as close
+ to actual event creation in client as possible, this timestamp will
+ be used for ordering of events in future release. Resolution:
+ milliseconds (required), microseconds (optimal).
+ metadata:
+ nullable: true
+ description: Optional. Metadata field used by the Langfuse SDKs for debugging.
required:
- id
- timestamp
- - metadata
TraceEvent:
title: TraceEvent
type: object
diff --git a/web/public/generated/postman/collection.json b/web/public/generated/postman/collection.json
index 310f6fbc66..3e5053bb46 100644
--- a/web/public/generated/postman/collection.json
+++ b/web/public/generated/postman/collection.json
@@ -337,7 +337,7 @@
"_type": "endpoint",
"name": "Batch",
"request": {
- "description": "Batched ingestion for Langfuse Tracing",
+ "description": "Batched ingestion for Langfuse Tracing. If you want to use tracing via the API, such as to build your own Langfuse client implementation, this is the only API route you need to implement.",
"url": {
"raw": "{{baseUrl}}/api/public/ingestion",
"host": [
@@ -356,7 +356,7 @@
"auth": null,
"body": {
"mode": "raw",
- "raw": "{\n \"batch\": [\n {\n \"type\": \"trace-create\",\n \"body\": {\n \"id\": \"example\",\n \"timestamp\": \"1994-11-05T13:15:30Z\",\n \"name\": \"example\",\n \"userId\": \"example\",\n \"input\": \"UNKNOWN\",\n \"output\": \"UNKNOWN\",\n \"sessionId\": \"example\",\n \"release\": \"example\",\n \"version\": \"example\",\n \"metadata\": \"UNKNOWN\",\n \"tags\": [\n \"example\"\n ],\n \"public\": true\n },\n \"id\": \"example\",\n \"timestamp\": \"example\",\n \"metadata\": \"UNKNOWN\"\n }\n ]\n}",
+ "raw": "{\n \"batch\": [\n {\n \"type\": \"trace-create\",\n \"body\": {\n \"id\": \"example\",\n \"timestamp\": \"1994-11-05T13:15:30Z\",\n \"name\": \"example\",\n \"userId\": \"example\",\n \"input\": \"UNKNOWN\",\n \"output\": \"UNKNOWN\",\n \"sessionId\": \"example\",\n \"release\": \"example\",\n \"version\": \"example\",\n \"metadata\": \"UNKNOWN\",\n \"tags\": [\n \"example\"\n ],\n \"public\": true\n },\n \"id\": \"example\",\n \"timestamp\": \"example\",\n \"metadata\": \"UNKNOWN\"\n }\n ],\n \"metadata\": \"UNKNOWN\"\n}",
"options": {
"raw": {
"language": "json"