Skip to content

Conversation

cuichen01
Copy link
Collaborator

What type of PR is this?

Check the PR title.

  • This PR title match the format: [<type>][<scope>]: <description>. For example: [fix][backend] flaky fix
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Add documentation if the current PR requires user awareness at the usage level.
  • This PR is written in English. PRs not in English will not be reviewed.

(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:

Copy link

codecov bot commented Sep 30, 2025

Codecov Report

❌ Patch coverage is 85.51069% with 61 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...bservability/domain/trace/service/trace_service.go 71.92% 12 Missing and 4 partials ⚠️
...dler/coze/loop/apis/observability_trace_service.go 0.00% 11 Missing ⚠️
backend/modules/observability/application/trace.go 89.53% 6 Missing and 3 partials ⚠️
...ckend/modules/observability/application/openapi.go 94.49% 4 Missing and 2 partials ⚠️
...ace/service/trace/span_processor/clip_processor.go 92.85% 4 Missing and 2 partials ⚠️
...kend/modules/observability/infra/repo/ck/common.go 61.53% 3 Missing and 2 partials ⚠️
.../observability/application/convertor/trace/span.go 0.00% 2 Missing and 1 partial ⚠️
...s/observability/infra/collector/event_collector.go 0.00% 3 Missing ⚠️
...er/coze/loop/apis/observability_open_apiservice.go 0.00% 2 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #217      +/-   ##
==========================================
+ Coverage   64.08%   64.12%   +0.04%     
==========================================
  Files         477      480       +3     
  Lines       51830    52216     +386     
==========================================
+ Hits        33214    33483     +269     
- Misses      16286    16375      +89     
- Partials     2330     2358      +28     
Flag Coverage Δ
unittests 64.12% <85.51%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ervability/domain/trace/entity/loop_span/filter.go 71.18% <ø> (ø)
...rvability/domain/trace/entity/otel/otel_pb2json.go 95.15% <100.00%> (ø)
...ackend/modules/observability/infra/config/trace.go 100.00% <100.00%> (ø)
...ckend/modules/observability/infra/repo/ck/spans.go 50.32% <100.00%> (+6.55%) ⬆️
backend/modules/observability/infra/repo/trace.go 61.49% <100.00%> (+0.46%) ⬆️
...er/coze/loop/apis/observability_open_apiservice.go 0.00% <0.00%> (ø)
.../observability/application/convertor/trace/span.go 52.90% <0.00%> (+13.85%) ⬆️
...s/observability/infra/collector/event_collector.go 0.00% <0.00%> (ø)
...kend/modules/observability/infra/repo/ck/common.go 61.53% <61.53%> (ø)
...ckend/modules/observability/application/openapi.go 72.73% <94.49%> (-10.76%) ⬇️
... and 4 more

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 803e5b2...942a25b. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

cuichen01 and others added 22 commits October 13, 2025 09:58
(LogID: 202510141631250100910941971269738)

Co-Authored-By: Coda <[email protected]>
(LogID: 202510141631250100910941971269738)

Co-Authored-By: Coda <[email protected]>
(LogID: 20251014175401010091094197096B65A)

Co-Authored-By: Coda <[email protected]>
🤖 Generated with Coda

Co-Authored-By: Coda <[email protected]>
(LogID: 2025101419340301009109419719038F1)

Co-Authored-By: Coda <[email protected]>
   🤖 Generated with Coda
(LogID: 202510142136120100910941975788B9C)

Co-Authored-By: Coda <[email protected]>
🤖 Generated with Coda

Co-Authored-By: Coda <[email protected]>
(LogID: 20251015121552010091094197109BD6B)

Co-Authored-By: Coda <[email protected]>
🤖 Generated with Coda

Co-Authored-By: Coda <[email protected]>
(LogID: 20251015121552010091094197109BD6B)

Co-Authored-By: Coda <[email protected]>
(LogID: 2025101517003901009109419764992EC)

Co-Authored-By: Coda <[email protected]>
(LogID: 2025101517003901009109419764992EC)

Co-Authored-By: Coda <[email protected]>
🤖 Generated with Coda

Co-Authored-By: Coda <[email protected]>
(LogID: 2025101517003901009109419764992EC)

Co-Authored-By: Coda <[email protected]>
(LogID: 2025101517003901009109419764992EC)

Co-Authored-By: Coda <[email protected]>
defer func() {
if req != nil {
o.metrics.EmitTraceOapi("SearchTraceOApi", req.WorkspaceID, req.GetPlatformType(), "", int64(spansSize), errCode, st, err != nil)
o.collector.CollectTraceOpenAPIEvent(ctx, "SearchTraceOApi", req.WorkspaceID, req.GetPlatformType(), "", int64(spansSize), errCode, st, err != nil)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是干嘛的

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

byteio上报到hive的,上线才能验证

func (o *OpenAPIApplication) validateSearchTraceTreeOApiReq(ctx context.Context, req *openapi.SearchTraceTreeOApiRequest) error {
if req == nil {
return errorx.NewByCode(obErrorx.CommercialCommonInvalidParamCodeCode, errorx.WithExtraMsg("no request provided"))
} else if req.GetTraceID() == "" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些尽可能idl里去校验吧

platformType := loop_span.PlatformType(req.GetPlatformType())
if req.PlatformType == nil {
platformType = loop_span.PlatformCozeLoop
platformType = loop_span.PlatformDefault
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default的配置和cozeloop都是一致的了是吧

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

预期default是目前所有配置的最小公共部分,上线前我再ckeck下

func (t *TraceConfigCenter) GetKeyColumns(ctx context.Context) []string {
keyColumns := make([]string, 0)
if err := t.UnmarshalKey(ctx, keyColumnsCfgKey, &keyColumns); err != nil {
return []string{"start_time", "span_id", "parent_id", "duration", "span_type", "span_name", "status_code", "tags_long", "logic_delete_date"}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个做用是什么?是不是写配置文件里

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

search tree需要的字段。tcc配置。这里是在配置文件

return keyColumns
}

func (t *TraceConfigCenter) GetKeySpanTypes(ctx context.Context) map[string]map[string][]string {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

map[string]map[string][]string这种结构可读性太差了,是不是定义一个结构体出来


import "github.com/samber/lo"

func getColumnStr(columns []string, omits []string) string {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是不是放到某个更通用的包里?和ck其实没关系,可能别的地方也会用到

case loop_span.FieldTypeDouble:
return fmt.Sprintf("system_tags_float['%s']", filter.FieldName), nil
default: // not expected to be here
return fmt.Sprintf("tags_string['%s']", filter.FieldName), nil
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

system?

return buf.String()
}

var spanColumns = []string{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

之前不需要定义出来的吗

QueryType: ptr.Of(loop_span.QueryTypeEnumIn),
})
}
filter.FilterFields = append(filter.FilterFields, &loop_span.FilterField{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getTrace为什么需要filter?

QueryEndTime int64 // ms
Tenant string
QueryTenants []string
SpanDoubleCheck bool
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这几个字段的作用是什么?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants