Skip to content

Conversation

@JqRrt
Copy link
Collaborator

@JqRrt JqRrt commented Dec 5, 2025

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

JqRrt and others added 17 commits December 2, 2025 11:48
Change-Id: I1274e7d69d8a86e160c5cd0b123da573d0ce71dd
Change-Id: I4e8103ed4f8bbcefe383a9f4aeff881ba9ae16ea
Change-Id: Ia22e14e7d9dd027b735aaa3222caed1fb3937eb8
Change-Id: Ib8d6987180c958e7f5654410b98b0477ea20f89a
Change-Id: Ic088c21db3efdc9115ca00b733ae2145f8244bb9
Change-Id: I33d7db20f81e4bc1059c5b8be2113e8826406395
@mocayo mocayo changed the title feat: trajectory observe [feat] [observation] trajectory observe Dec 5, 2025
@mocayo
Copy link
Collaborator

mocayo commented Dec 5, 2025

Submission history contains excessive meaningless information, please organize it

Copy link
Collaborator

@mocayo mocayo left a comment

Choose a reason for hiding this comment

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

reorganize commit message and resolve conflicts

@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

❌ Patch coverage is 5.39877% with 771 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...bility/domain/trace/entity/loop_span/trajectory.go 0.00% 264 Missing ⚠️
...bservability/domain/trace/service/trace_service.go 0.49% 203 Missing ⚠️
...vability/application/convertor/trace/trajectory.go 0.00% 106 Missing ⚠️
backend/modules/observability/application/trace.go 0.00% 63 Missing ⚠️
backend/modules/observability/infra/repo/trace.go 18.18% 45 Missing ⚠️
.../observability/application/convertor/trace/span.go 2.50% 39 Missing ⚠️
...ility/domain/trace/service/trace_export_service.go 45.45% 15 Missing and 3 partials ⚠️
...api/handler/coze/loop/apis/eval_open_apiservice.go 0.00% 9 Missing ⚠️
...i/handler/coze/loop/apis/evaluation_set_service.go 0.00% 9 Missing ⚠️
...dler/coze/loop/apis/observability_trace_service.go 0.00% 6 Missing ⚠️
... and 4 more

❌ Your patch check has failed because the patch coverage (5.39%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #332      +/-   ##
==========================================
- Coverage   69.88%   68.92%   -0.96%     
==========================================
  Files         588      590       +2     
  Lines       54452    55246     +794     
==========================================
+ Hits        38052    38077      +25     
- Misses      13525    14291     +766     
- Partials     2875     2878       +3     
Flag Coverage Δ
unittests 68.92% <5.39%> (-0.96%) ⬇️

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

Files with missing lines Coverage Δ
...bility/application/convertor/trace/trace_export.go 95.85% <100.00%> (+0.11%) ⬆️
.../modules/observability/domain/task/entity/event.go 58.13% <100.00%> (ø)
...dules/observability/domain/trace/entity/dataset.go 85.60% <100.00%> (+0.23%) ⬆️
...bservability/domain/trace/entity/loop_span/span.go 75.92% <100.00%> (+0.18%) ⬆️
...infra/mq/producer/span_with_annotation_producer.go 95.23% <100.00%> (ø)
...modules/evaluation/application/eval_openapi_app.go 91.50% <0.00%> (-0.30%) ⬇️
...dules/evaluation/application/evaluation_set_app.go 62.71% <0.00%> (-0.28%) ⬇️
...vability/infra/rpc/evaluationset/evaluation_set.go 45.16% <33.33%> (-0.13%) ⬇️
...domain/task/service/taskexe/tracehub/subscriber.go 68.42% <0.00%> (-1.85%) ⬇️
...dler/coze/loop/apis/observability_trace_service.go 0.00% <0.00%> (ø)
... and 9 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 5177532...4466987. 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.

Copy link
Collaborator

@CozeLoop CozeLoop left a comment

Choose a reason for hiding this comment

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

Summary: Found compile-blocking issue in otel FieldConf map and a missing middleware function reference in router.

  • [🚫Must Fix] backend/modules/observability/lib/otel/otel_convert.go: Struct literal for FieldConf uses non-existent field names (attributeKey, isTag, dataType). Replace with AttributeKey, IsTag, DataType.
  • [🚨Should Fix] backend/api/router/coze/loop/apis/coze.loop.apis.go: Route references _gettrajectoryconfigMw but the stub is not defined in middleware.go. Add the missing middleware function.

Please address these to unblock compilation and ensure routing consistency.

Comment on lines +276 to +281
// 按开始时间排序
for i := 0; i < len(children); i++ {
for j := i + 1; j < len(children); j++ {
if children[i].StartTime > children[j].StartTime {
children[i], children[j] = children[j], children[i]
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

[💡Suggestion] Sorting children can use sort.Slice for clarity and O(n log n) complexity: sort.Slice(children, func(i, j int) bool { return children[i].StartTime < children[j].StartTime }).

TraceID: span.TraceId,
DurationMicros: (endTimeUnixNanoInt64 - startTimeUnixNanoInt64) / 1000,
PSM: "",
PSM: psm,
Copy link
Collaborator

Choose a reason for hiding this comment

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

No risk detected for this change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

无问题

IsTag: true,
DataType: dataTypeString,
},
"psm": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

[🚫Must Fix] Struct literal uses unknown field names for FieldConf

attributeKey, isTag, and dataType are not fields of FieldConf (the correct names are AttributeKey, IsTag, and DataType). This will fail to compile with “unknown field” errors. Please use the exported field names.

Suggestion:

"psm": {
    AttributeKey: []string{"service.name"},
    IsTag:        false,
    DataType:     dataTypeString,
},

@JqRrt JqRrt force-pushed the feat_trajectory_observe branch from 9406baf to f97ef04 Compare December 8, 2025 03:11
update

fix
@JqRrt JqRrt force-pushed the feat_trajectory_observe branch from 1d9c7e2 to 4466987 Compare December 8, 2025 11:57
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.

6 participants