mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
feat(clickhouse): add agent names to the per-trace rollup
This commit is contained in:
parent
eaa97090f4
commit
f512c161f0
1 changed files with 2 additions and 0 deletions
|
|
@ -91,6 +91,7 @@ CREATE TABLE IF NOT EXISTS {db}.{AGENT_TRACES_TABLE}
|
|||
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
|
||||
|
|
@ -116,6 +117,7 @@ SELECT
|
|||
sum(InputTokens) AS InputTokens,
|
||||
sum(OutputTokens) AS OutputTokens,
|
||||
groupUniqArrayIf(toString(Model), Model != '') AS Models,
|
||||
groupUniqArrayIf(SpanName, ObservationType = 'agent') AS AgentNames,
|
||||
groupArrayIf(LiteLLMRequestId, LiteLLMRequestId != '') AS RequestIds
|
||||
FROM {db}.{OTEL_TRACES_TABLE}
|
||||
GROUP BY TeamId, TraceId
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue