mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-30 01:08:33 +00:00
* feat(tracing): bring current ingestion prerequisite onto main
Port the prerequisite implementation from BerriAI/litellm#43915 at 5aacd57455 so Lens does not depend on the retired tracing stack.
* feat(lens): add trace analysis and standalone worker
* fix(lens): clarify review limits and finalize main integration
* fix(lens): simplify worker setup and show the next check
* fix(lens): simplify analyzer setup and resolve integration failures
* fix(lens): preserve durations and evidence from later trace reads
* fix(lens): trust server context for internal analysis exclusion
* fix(lens): pin reviewed analyzer image and verify request inclusion
* test(lens): select time units before entering custom duration
* test(lens): allow the standalone analyzer lifetime HTTP client
* test(lens): run analyzer tests in active proxy coverage shard
14 lines
991 B
SQL
14 lines
991 B
SQL
SELECT sum(matches) AS count FROM (
|
|
SELECT count() AS matches FROM otel_traces WHERE {source:String}='traces'
|
|
AND ({all_teams:UInt8}=1 OR TeamId={team:String})
|
|
AND ({key_hash:String}='' OR ApiKeyHash={key_hash:String})
|
|
AND ({trace_ref:String}='' OR hex(SHA256(concat(TeamId, char(0), ApiKeyHash, char(0), TraceId)))={trace_ref:String})
|
|
AND TraceId={id:String} AND TeamId={record_team:String} AND SpanId={span:String}
|
|
AND position(concat('Input: ',Input,'\nOutput: ',Output,'\nStatus: ',StatusCode,' ',StatusMessage),{quote:String})>0
|
|
UNION ALL
|
|
SELECT count() AS matches FROM spend_logs FINAL WHERE {source:String}='requests'
|
|
AND ({all_teams:UInt8}=1 OR team_id={team:String})
|
|
AND ({key_hash:String}='' OR api_key={key_hash:String})
|
|
AND request_id={id:String} AND team_id={record_team:String} AND request_id={span:String}
|
|
AND position(concat('Input: ',messages,'\nOutput: ',response,'\nError: ',error_str),{quote:String})>0
|
|
)
|