[feat][trace] input/output configurable preview & agent metadata discovery#492
[feat][trace] input/output configurable preview & agent metadata discovery#492fanhua-bytedance wants to merge 20 commits intomainfrom
Conversation
fea6639 to
a4d80b8
Compare
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #492 +/- ##
==========================================
+ Coverage 77.14% 77.18% +0.03%
==========================================
Files 650 653 +3
Lines 72527 72825 +298
==========================================
+ Hits 55953 56211 +258
- Misses 13241 13271 +30
- Partials 3333 3343 +10
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
a4d80b8 to
129e512
Compare
…to fix CK Missing columns error
…fields to fix AGW body parsing
…onfig, GetAgentMetadata
129e512 to
bb67520
Compare
…ql for schema consistency
Reuse BuildBuiltinFilters + CombineFilters to add space_id and call_type filters, consistent with ListSpans logic.
| InsertAnnotations(context.Context, *InsertAnnotationParam) error | ||
| UpsertTrajectoryConfig(context.Context, *UpsertTrajectoryConfigParam) error | ||
| GetTrajectoryConfig(context.Context, GetTrajectoryConfigParam) (*entity.TrajectoryConfig, error) | ||
| UpsertColumnExtractConfig(context.Context, *UpsertColumnExtractConfigParam) error |
There was a problem hiding this comment.
这个单独拆一个repo吧,和trace也没有太多关系
| GetTrajectories(ctx context.Context, workspaceID int64, traceIDs []string, startTime, endTime int64, | ||
| platformType loop_span.PlatformType) (map[string]*loop_span.Trajectory, error) | ||
| MergeHistoryMessagesByRespIDBatch(ctx context.Context, spans []*loop_span.Span, platformType loop_span.PlatformType) error | ||
| UpsertColumnExtractConfig(ctx context.Context, req *UpsertColumnExtractConfigRequest) error |
There was a problem hiding this comment.
ColumnExtractConfig 单独拆一个service吧,和trace关系不大。这里逻辑其实非常简单,直接application调repo都行,类似view的写法
GetAgentMetadata查trace的,可以放着
| IsCustom: true, | ||
| }, | ||
| { | ||
| FieldName: tagKeyGenAIAgentName, |
| tagKeyGenAIAgentName = "gen_ai.agent.name" | ||
| ) | ||
|
|
||
| func extractAgentName(s *loop_span.Span) string { |
| } | ||
| var agentName string | ||
| _ = filters.Traverse(func(f *loop_span.FilterField) error { | ||
| if f.FieldName == tagKeyAgentName || f.FieldName == tagKeyGenAIAgentName { |
| spanRedisDao redis_dao.ISpansRedisDao, | ||
| spanProducer mq.ISpanProducer, | ||
| trajectoryConfDao mysql.ITrajectoryConfigDao, | ||
| columnExtractConfDao mysql.IColumnExtractConfigDao, |
| clipProcessorSuffix = "..." | ||
| ) | ||
|
|
||
| var defaultExtractRules = map[loop_span.SpanListType][]entity.ColumnExtractRule{ |
There was a problem hiding this comment.
这个是什么时候会用到的?
数据库无记录或配置为空的情况会使用默认配置
| if span == nil { | ||
| var rules []entity.ColumnExtractRule | ||
| if c.traceRepo != nil && c.settings.WorkspaceId > 0 { | ||
| cfg, err := c.traceRepo.GetColumnExtractConfig(ctx, repo.GetColumnExtractConfigParam{ |
There was a problem hiding this comment.
这里应该缺了这个空间没有配置,取全局的默认配置逻辑吧?
There was a problem hiding this comment.
目前是如果无配置则会返回适用于ModelSpan的默认配置,对与自定义上报和其他的类型的还没做默认配置。
这里应该缺了这个空间没有配置,取全局的默认配置逻辑吧?
0ac1b95 to
5d9668d
Compare
61d5c40 to
78044f6
Compare
b7bb283 to
fea7e85
Compare
…for ClipProcessor
fea7e85 to
d149df0
Compare
c2c4da4 to
02ea69d
Compare
5d000b3 to
bb1534c
Compare
bb1534c to
f4f75ea
Compare
- Move SelectBest/Extract/configScore logic from clip_processor to entity layer - Use workspace_id=0 for global default configs with wildcard '*' matching - Add 4-bit scoring strategy (workspace > agent > spanListType > platformType) - Simplify ClipProcessor.Transform to delegate to entity layer - Add DB error logging consistent with other processors - Seed 3 default extract configs via init SQL with fixed IDs for idempotency - Add comprehensive tests for SelectBest, configScore, Extract
…te default configs - Rewrite SelectBest to use two-phase direct matching instead of bit-score approach - Reduce default column extract configs from 3 to 2: (0,*,llm_span) and (0,prompt,root_span) - Change span_list_type SQL query from wildcard IN to exact match - Update tests with 20 cases for 100% SelectBest coverage
What type of PR is this?
Check the PR title
(Optional) Translate the PR title into Chinese
(Optional) More detailed description for this PR(en: English/zh: Chinese)
en:
zh(optional):
(Optional) Which issue(s) this PR fixes