mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-11 03:38:38 +00:00
Add the litellm-pagination crate (Page envelope, signed expiring cursors bound to resource, scope, query and revision, stable failure codes) and move the trace list, trace detail and span error reads onto it. The list pins a publication fence through a new ReceivedMs rollup column so continuation pages exclude later-received rows. The Python bridge raises TraceReadError(code, message), the proxy maps codes to 400/409/410/413/503 with Retry-After, cursor keys come from tracing.store.cursor_keys with LITELLM_SALT_KEY and LITELLM_MASTER_KEY fallbacks, and Lens consumes the items envelope and shows Refresh instead of Retry when a traversal is gone. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
191 lines
4.3 KiB
JSON
191 lines
4.3 KiB
JSON
{
|
|
"$defs": {
|
|
"SpanStatus": {
|
|
"enum": [
|
|
"ok",
|
|
"error",
|
|
"unset"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"TraceSummary": {
|
|
"properties": {
|
|
"agent_count": {
|
|
"format": "uint64",
|
|
"maximum": 18446744073709551615,
|
|
"minimum": 0,
|
|
"type": "integer"
|
|
},
|
|
"agent_invocations": {
|
|
"format": "uint64",
|
|
"maximum": 18446744073709551615,
|
|
"minimum": 0,
|
|
"type": "integer"
|
|
},
|
|
"agent_names": {
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"type": "array",
|
|
"x-python-optional": true
|
|
},
|
|
"duration_ms": {
|
|
"format": "double",
|
|
"type": "number"
|
|
},
|
|
"error_count": {
|
|
"format": "uint64",
|
|
"maximum": 18446744073709551615,
|
|
"minimum": 0,
|
|
"type": "integer"
|
|
},
|
|
"frameworks": {
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"type": "array",
|
|
"x-python-optional": true
|
|
},
|
|
"input_preview": {
|
|
"type": "string"
|
|
},
|
|
"input_tokens": {
|
|
"format": "uint64",
|
|
"maximum": 18446744073709551615,
|
|
"minimum": 0,
|
|
"type": "integer"
|
|
},
|
|
"llm_calls": {
|
|
"format": "uint64",
|
|
"maximum": 18446744073709551615,
|
|
"minimum": 0,
|
|
"type": "integer"
|
|
},
|
|
"models": {
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"type": "array"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"output_tokens": {
|
|
"format": "uint64",
|
|
"maximum": 18446744073709551615,
|
|
"minimum": 0,
|
|
"type": "integer"
|
|
},
|
|
"resolution_limited": {
|
|
"type": "boolean",
|
|
"x-python-optional": true
|
|
},
|
|
"service": {
|
|
"type": "string"
|
|
},
|
|
"span_count": {
|
|
"format": "uint64",
|
|
"maximum": 18446744073709551615,
|
|
"minimum": 0,
|
|
"type": "integer"
|
|
},
|
|
"spend": {
|
|
"format": "double",
|
|
"type": [
|
|
"number",
|
|
"null"
|
|
]
|
|
},
|
|
"start_time": {
|
|
"type": "string"
|
|
},
|
|
"status": {
|
|
"$ref": "#/$defs/SpanStatus"
|
|
},
|
|
"tool_calls": {
|
|
"format": "uint64",
|
|
"maximum": 18446744073709551615,
|
|
"minimum": 0,
|
|
"type": "integer"
|
|
},
|
|
"trace_id": {
|
|
"type": "string"
|
|
},
|
|
"trace_ref": {
|
|
"type": "string",
|
|
"x-python-optional": true
|
|
}
|
|
},
|
|
"required": [
|
|
"resolution_limited",
|
|
"trace_id",
|
|
"trace_ref",
|
|
"name",
|
|
"service",
|
|
"agent_names",
|
|
"frameworks",
|
|
"input_preview",
|
|
"start_time",
|
|
"duration_ms",
|
|
"status",
|
|
"span_count",
|
|
"agent_count",
|
|
"agent_invocations",
|
|
"llm_calls",
|
|
"tool_calls",
|
|
"error_count",
|
|
"input_tokens",
|
|
"output_tokens",
|
|
"models",
|
|
"spend"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"Traversal": {
|
|
"description": "The pinned traversal a page belongs to. Every page of one traversal shares `id`, sees the\ndata as published at `published_at`, and can be continued until `expires_at`.",
|
|
"properties": {
|
|
"expires_at": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"published_at": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"published_at",
|
|
"expires_at"
|
|
],
|
|
"type": "object"
|
|
}
|
|
},
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"description": "One page of an ordered traversal: a complete ordered prefix of what remains, and either the\nopaque cursor for the rest or `None` when the traversal is exhausted.",
|
|
"properties": {
|
|
"items": {
|
|
"items": {
|
|
"$ref": "#/$defs/TraceSummary"
|
|
},
|
|
"type": "array"
|
|
},
|
|
"next_cursor": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"traversal": {
|
|
"$ref": "#/$defs/Traversal"
|
|
}
|
|
},
|
|
"required": [
|
|
"items",
|
|
"next_cursor",
|
|
"traversal"
|
|
],
|
|
"title": "TracePage",
|
|
"type": "object"
|
|
}
|