Skip to content

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

Open
andreiborza wants to merge 6 commits into
cleptric/ai-agents-develop-docsfrom
ab/ai-agents-extract-span
Open

andreiborza wants to merge 6 commits into
cleptric/ai-agents-develop-docsfrom
ab/ai-agents-extract-span

Conversation

@andreiborza

@andreiborza andreiborza commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

What

Documents the JSON fields of the decision and extraction input and output messages, and adds the Extraction Span (gen_ai.extract) from getsentry/sentry-conventions#728.

Why

Other SDKs need to know what to send for these spans and how to map provider data to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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 Oct 21, 2026 8:35am UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-docs Ignored Ignored Preview Oct 21, 2026 8:35am UTC

Request Review

@github-actions github-actions Bot added sdk-develop-docs PRs touching develop-docs/sdk Priority: Needs Triage The PR description is missing valid priority information labels Oct 20, 2026
@andreiborza
andreiborza added this pull request to stack #20108 October 20, 2026 13:08
@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 <7033940+ArthurKnaus@users.noreply.github.com>

This branch was successfully deployed

1 active deployment
Preview – develop-docs — ad104038 Deployed Oct 21, 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.

3 participants