Skip to content

docs(develop): Document decision and extraction spans - #20107

Merged
andreiborza merged 5 commits into
masterfrom
ab/ai-agents-extract-span
Nov 11, 2026
Merged

andreiborza merged 5 commits into
masterfrom
ab/ai-agents-extract-span

Conversation

@andreiborza

@andreiborza andreiborza commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

What

Adds the Decision Span (gen_ai.decide) and Extraction Span (gen_ai.extract) to the AI Agents module page, and fixes the extract op in the span relationship examples. <ConventionAttributes> can now show a specific example from the conventions, so these spans show decide and extract examples instead of chat ones.

Why

SDKs need to know what to send for these spans. The message field details will come from getsentry/sentry-conventions#728 once they land there.

@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
develop-docs Ready Ready Preview Nov 11, 2026 9:45am UTC
sentry-docs Ready Ready Preview Nov 11, 2026 9:45am UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

Please update the IS YOUR CHANGE URGENT? section of the PR description:

  • Select exactly one option.
  • If you selected an urgent or other deadline, provide the date as YYYY-MM-DD.

This information helps the Docs team prioritize your review.

@coolguyzone coolguyzone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

ArthurKnaus added a commit that referenced this pull request Nov 4, 2026
## DESCRIBE YOUR PR

Documents the `gen_ai.extract` span in the agent tracing manual
instrumentation guides, modeled on the existing Decision and Memory span
sections. Follows
[sentry-conventions#728](getsentry/sentry-conventions#728),
which adds the experimental `gen_ai.extract` op, the `extract` operation
name, and the extraction shapes for `gen_ai.input.messages` /
`gen_ai.output.messages`.

- Add an "Extraction Span" section to the JavaScript and Python manual
instrumentation pages, placed after "Decision Span". The example uses a
Clairic invoice extraction (same data as the conventions examples):
`gen_ai.extract` op, `extract {model}` name, `gen_ai.operation.name:
"extract"`, the request body without `model` as input messages, and the
response body without `model` and `usage` as output messages
- Add a shared `extraction-span` attributes include: required
op/name/operation name, model, provider, and agent attributes, token
usage, and the input format (`state`, `fields`, `images`,
`reference_date`, `options`, plus field spec types) and output format
(`answers`, `truncated`, `span`/`spans` offsets)
- JS page links to the Workers AI integration, which creates these spans
automatically for Clairic since `@sentry/cloudflare` 11.10.0

Attribute values were checked against sentry-conventions
(`model/op/gen_ai.json`, `gen_ai.operation.name`,
`gen_ai.input.messages`, `gen_ai.output.messages`), the JS Workers AI
instrumentation (`cloudflare.workers_ai` provider name), and the
product's extraction parser (spans are recognized by
`gen_ai.operation.name`).

**Open questions before ready for review**

- The field-level message format overlaps with the develop-docs spec in
#20107 (still open). Once that merges, should the include link there
instead of repeating the field tables?
- The existing Decision span docs still show `{type: "evaluation", ...}`
wrappers, which the current conventions examples and #20107 drop. Out of
scope here, but worth a follow-up.

Refs
[AGT-3212](https://linear.app/getsentry/issue/AGT-3212/manual-instrumentation-docs-for-extraction-spans)

## IS YOUR CHANGE URGENT?

- [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD
- [ ] Other deadline: YYYY-MM-DD
- [x] No deadline: Not urgent, can wait up to 1 week+

## PRE-MERGE CHECKLIST

- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)

<!-- junior-request-attribution:start -->
via @ArthurKnaus.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AD0BQH18P75H%3A1793724768.708079 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/slack%3AD0BQH18P75H%3A1793724768.708079)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AD0BQH18P75H%3A1793724768.708079/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Arthur Knaus <[email protected]>
@andreiborza
andreiborza force-pushed the ab/ai-agents-extract-span branch from ad10403 to 6b88ca2 Compare November 11, 2026 09:08
@andreiborza
andreiborza requested a review from a team as a code owner November 11, 2026 09:08
@codeowner-assignment
codeowner-assignment Bot requested review from a team and removed request for a team November 11, 2026 09:08
@codeowner-assignment
codeowner-assignment Bot requested review from NinjaLikesCheez, alwx, antonis, markushi, philprime and runningcode and removed request for a team November 11, 2026 09:09
@andreiborza
andreiborza removed this pull request from stack #20108 November 11, 2026 09:09
@andreiborza
andreiborza changed the base branch from cleptric/ai-agents-develop-docs to master November 11, 2026 09:09
@andreiborza andreiborza changed the title docs(develop): Document decision and extraction message structure docs(develop): Document decision and extraction spans Nov 11, 2026
@andreiborza
andreiborza merged commit dcc0a19 into master Nov 11, 2026
31 checks passed
@andreiborza
andreiborza deleted the ab/ai-agents-extract-span branch November 11, 2026 15:12

This branch was successfully deployed

2 active deployments
Preview – sentry-docs — 1dbf5591 Deployed Nov 11, 2026 by vercel[bot]
Preview – develop-docs — 1dbf5591 Deployed Nov 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Needs Triage The PR description is missing valid priority information sdk-develop-docs PRs touching develop-docs/sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants