Skip to content

[feat][backend] support trajectory openapi #552

Merged
SharkeyChen merged 2 commits into
mainfrom
feat/trajectory_openapi
Jun 17, 2026
Merged

[feat][backend] support trajectory openapi #552
SharkeyChen merged 2 commits into
mainfrom
feat/trajectory_openapi

Conversation

@SharkeyChen

Copy link
Copy Markdown
Collaborator

Add a new public OpenAPI endpoint to retrieve trajectory data by trace IDs.

  • Define ListTrajectoryOApiRequest/Response/Data in thrift IDL
  • Add ListTrajectoryOApi method to OpenAPIService (POST /v1/loop/traces/trajectory)
  • Implement application layer with validation, auth, rate limiting, and time range handling
  • Update handler to use standard invokeAndRender pattern
  • Route registered at /v1/loop/traces/trajectory

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

Add a new public OpenAPI endpoint to retrieve trajectory data by trace IDs.

- Define ListTrajectoryOApiRequest/Response/Data in thrift IDL
- Add ListTrajectoryOApi method to OpenAPIService (POST /v1/loop/traces/trajectory)
- Implement application layer with validation, auth, rate limiting, and time range handling
- Update handler to use standard invokeAndRender pattern
- Route registered at /v1/loop/traces/trajectory
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.00000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...er/coze/loop/apis/observability_open_apiservice.go 0.00% 2 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #552      +/-   ##
==========================================
+ Coverage   77.61%   77.66%   +0.05%     
==========================================
  Files         670      670              
  Lines       76017    76101      +84     
==========================================
+ Hits        58997    59102     +105     
+ Misses      13567    13543      -24     
- Partials     3453     3456       +3     
Flag Coverage Δ
unittests 77.66% <96.00%> (+0.05%) ⬆️

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

Files with missing lines Coverage Δ
...ckend/modules/observability/application/openapi.go 84.83% <100.00%> (+0.93%) ⬆️
...er/coze/loop/apis/observability_open_apiservice.go 0.00% <0.00%> (ø)

... and 5 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 81a4492...80cb627. 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.

kidkidkid
kidkidkid previously approved these changes Jun 17, 2026
Cover all branches:
- success with start_time provided
- success with start_time nil (uses benefit service)
- success with nil service response
- invalid request (nil, zero workspace_id, empty trace_ids, empty trace_id)
- permission error
- rate limited
- user missing when start_time nil
- service error
@SharkeyChen SharkeyChen force-pushed the feat/trajectory_openapi branch from 1dce75e to 80cb627 Compare June 17, 2026 13:12
@SharkeyChen SharkeyChen merged commit cf9173b into main Jun 17, 2026
17 of 18 checks passed
@SharkeyChen SharkeyChen deleted the feat/trajectory_openapi branch June 17, 2026 14:50
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.

3 participants