Skip to content

feat(aivision): add storage-side trace pagination endpoint - #8

Merged
Evenss merged 1 commit into
mainfrom
codex/trace-storage-pagination
Oct 15, 2026
Merged

Evenss merged 1 commit into
mainfrom
codex/trace-storage-pagination

Conversation

@Evenss

@Evenss Evenss commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Related to ob-labs/ai-vision-ob#67. Companion change for AI Vision trace list pagination.

Add GET /api/v1/ai-vision/traces/page. A single OceanBase SQL statement performs trace-level filtering, stable sorting, pagination, total counting, and facet aggregation, returning complete spans only for the requested page. This removes the need for callers to fetch every trace in the time window individually.

Changes

  • Introduce the versioned native-trace-page-v1 contract, with page data, totals, and facets computed from the same query snapshot.
  • Support common queries involving trace ID, timestamps, duration, status, span count, environment, scene, username, Agent UUID, and tags.
  • Preserve cross-span filtering semantics, resource username precedence, and latest-tag-update behavior.
  • Validate Space and Agent identities across the window, duplicate spans, and completeness counts while preserving telemetry JSON numeric precision.
  • Reuse the main API authentication and authorization. Return explicit supported:false responses for unsupported queries so callers can select a compatibility path.

Validation

  • Passed go test ./pkg/modules/aivision ./pkg/apiserver/signozapiserver.
  • Real OceanBase integration tests cover complete pagination over 211 and 1,000 traces, with one SQL statement per page request.
  • Compared filtering, ordering, totals, and facets against AI Vision's existing implementation.
  • Covered invalid identities, empty and out-of-range pages, capacity limits, nanosecond precision, and tag aggregation regressions.
  • Passed the companion AI Vision browser flow covering login, pagination, filtering, IO, and trace details.

Boundaries

The endpoint supports OceanBase, with a maximum of 200 traces per page. Individual traces remain subject to the span-count limit. Separate page requests may observe subsequent ingestion; completeness describes the current page and statistics computed by the same statement.

Deploy this endpoint before upgrading the AI Vision caller.

- Add GET /traces/page route to the AI vision API server and handler interface.
- Add AgentUUID to native trace list params to support filtering by agent identity.
@github-actions github-actions Bot added the enhancement New feature or request label Oct 15, 2026

@kic635 kic635 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@Evenss
Evenss merged commit 4dbe0ae into main Oct 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants