Skip to main content
POST
/
ingest
Ingest a batch of traces
curl --request POST \
  --url http://localhost:4000/ingest \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "version": "v1",
  "traces": [
    {
      "traceId": "0192f1c0-1a2b-7c3d-8e4f-1a2b3c4d5e6f",
      "spans": [
        {
          "spanId": "span_1",
          "spanType": "llm",
          "name": "generateText",
          "startTime": 1716566400000,
          "endTime": 1716566401200,
          "parentSpanId": "span_0",
          "status": "ok",
          "errorMessage": "<string>",
          "provider": "openai",
          "modelId": "gpt-4o",
          "usage": {
            "inputTokens": 1200,
            "outputTokens": 350,
            "totalTokens": 1550,
            "reasoningTokens": 1,
            "cachedInputTokens": 1,
            "cacheWriteInputTokens": 1,
            "imageCount": 1,
            "webSearchCount": 1,
            "requestCount": 1
          },
          "ttftMs": 320,
          "input": "<string>",
          "output": "<string>",
          "metadata": {
            "environment": "production",
            "region": "us-east-1"
          }
        }
      ],
      "agentName": "summarizer",
      "workflowName": "deploy-digest",
      "workflowRunId": "run_2024_05_24",
      "sessionId": "session_abc123",
      "metadata": {
        "environment": "production",
        "region": "us-east-1"
      }
    }
  ]
}
'
{
  "accepted": 3
}

Documentation Index

Fetch the complete documentation index at: https://docs.foglamp.dev/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Send your API key as Authorization: Bearer fl_….

Body

application/json

A versioned batch of traces.

version
string
required

Wire contract version.

Allowed value: "v1"
Example:

"v1"

traces
object[]
required
Required array length: 1 - 1000 elements

Response

Batch accepted into the write buffer.

accepted
integer
required

Number of span rows accepted.

Example:

3