mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-01 01:18:34 +00:00
25 lines
1.3 KiB
SQL
25 lines
1.3 KiB
SQL
CREATE TABLE IF NOT EXISTS {database}.agent_traces_by_key
|
|
(
|
|
TeamId LowCardinality(String),
|
|
ApiKeyHash String,
|
|
TraceId String,
|
|
StartTs SimpleAggregateFunction(min, DateTime64(9)),
|
|
EndTs SimpleAggregateFunction(max, DateTime64(9)),
|
|
ServiceName SimpleAggregateFunction(any, LowCardinality(String)),
|
|
RootName SimpleAggregateFunction(anyLast, Nullable(String)),
|
|
RootInput SimpleAggregateFunction(anyLast, Nullable(String)),
|
|
RootStatus SimpleAggregateFunction(anyLast, Nullable(String)),
|
|
SpanCount SimpleAggregateFunction(sum, UInt64),
|
|
AgentCount SimpleAggregateFunction(sum, UInt64),
|
|
LlmCount SimpleAggregateFunction(sum, UInt64),
|
|
ToolCount SimpleAggregateFunction(sum, UInt64),
|
|
ErrorCount SimpleAggregateFunction(sum, UInt64),
|
|
InputTokens SimpleAggregateFunction(sum, UInt64),
|
|
OutputTokens SimpleAggregateFunction(sum, UInt64),
|
|
Models SimpleAggregateFunction(groupUniqArrayArray, Array(String)),
|
|
AgentNames SimpleAggregateFunction(groupUniqArrayArray, Array(String)),
|
|
RequestIds SimpleAggregateFunction(groupArrayArray, Array(String))
|
|
)
|
|
ENGINE = AggregatingMergeTree
|
|
ORDER BY (TeamId, ApiKeyHash, TraceId)
|
|
SETTINGS non_replicated_deduplication_window = 1000
|