Skip to content

docs(api): reference docs for tracing ingest/query and create-simple-trace endpoints#4174

Open
mmabrouk wants to merge 1 commit intomainfrom
docs/age-3734-tracing-endpoint-reference-docs
Open

docs(api): reference docs for tracing ingest/query and create-simple-trace endpoints#4174
mmabrouk wants to merge 1 commit intomainfrom
docs/age-3734-tracing-endpoint-reference-docs

Conversation

@mmabrouk
Copy link
Copy Markdown
Member

@mmabrouk mmabrouk commented Apr 17, 2026

Summary

The reference pages for /tracing/spans/ingest, /tracing/spans/query, and /preview/tracing/traces/ (create_simple_trace) had no description, no per-field prose, and no example payload — the generated schema trees alone don't tell you what to send or when to use which endpoint. A customer hit this while trying to migrate traces between two Agenta instances: they reverse-engineered the body shape, then lost every span silently to a validation edge case that the docs gave them no way to anticipate (see AGE-3734, AGE-3735).

This PR adds route docstrings and Pydantic Field(description=...) so the next person reading the reference can actually build a valid payload.

Changes

  • ingest_spans: docstring explaining spans vs traces body shape, attribute namespacing (ag.*), and that count < N submitted means partial failure. Includes a worked JSON example.
  • query_spans: docstring explaining focus="trace" vs focus="span", windowing, and confirming the traces shape round-trips into ingest.
  • create_simple_trace: docstring with an explicit "use this vs /tracing/spans/ingest" guide — single-span helper for evaluator outputs, annotations, feedback, and standalone completions.
  • Field descriptions on OTelTracingRequest, OTelLinksResponse, OTelTracingResponse, SimpleTraceCreateRequest, SimpleTraceResponse.

FastAPI reads docstrings and Field(description=...) when regenerating openapi.json. The daily .github/workflows/33-update-api-docs.yml workflow pulls that spec and regenerates the Docusaurus MDX — so no docs-side changes are needed in this PR; the reference pages update on the next scheduled run.

Related

  • AGE-3734 — query ↔ ingest schema asymmetry on ag.metrics.duration.cumulative
  • AGE-3735 — per-span validation errors drop the whole batch instead of landing in unsupported

These are the underlying bugs surfaced by the same customer report; this PR only addresses the reference-doc gap so the endpoint is usable once the fixes ship.

Test plan

  • uvx ruff format and uvx ruff check pass on the four changed files
  • Python syntax validates via ast.parse
  • After merge, confirm the daily update-api-docs workflow regenerates docs/reference/api/ingest-spans-rpc.api.mdx, query-spans-rpc.api.mdx, and create-simple-trace.api.mdx with the new descriptions
  • Spot-check the rendered Docusaurus pages for the three endpoints

Open with Devin

…ce endpoints

Reference pages for these endpoints had no description, no per-field prose,
and no example payload, making it non-obvious what shape to send. Customers
had to reverse-engineer the request body from the generated schema tree.

Adds:
- Route docstrings on `ingest_spans`, `query_spans`, and `create_simple_trace`
  explaining when to use each, the body shape, and how to interpret the
  response (in particular, that `count < N submitted` signals partial failure).
- Field descriptions on `OTelTracingRequest`, `OTelLinksResponse`,
  `OTelTracingResponse`, `SimpleTraceCreateRequest`, and `SimpleTraceResponse`
  so the OpenAPI schema tables are self-explanatory.
- A worked JSON example on `ingest_spans` and guidance on choosing
  `ingest-spans-rpc` vs `create-simple-trace`.

FastAPI picks docstrings + `Field(description=...)` up automatically when
regenerating `openapi.json`, and the daily `33-update-api-docs` workflow
regenerates the Docusaurus MDX from that. No docs-side changes needed.
@linear
Copy link
Copy Markdown

linear Bot commented Apr 17, 2026

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Apr 17, 2026 3:47pm

Request Review

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 17, 2026
@dosubot dosubot Bot added the documentation Improvements or additions to documentation label Apr 17, 2026
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@mmabrouk mmabrouk requested a review from jp-agenta April 17, 2026 15:50
@github-actions
Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-production-7aef.up.railway.app/w
Image tag pr-4174-30049b1
Status Failed
Railway logs Open logs
Logs View workflow run
Updated at 2026-04-17T15:55:29.051Z

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants