You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Instrument Cloudflare Clairic as gen_ai.extract spans #25615
The Extraction span spec adds gen_ai.extract spans. The JS SDK does not emit them.
Current behavior
getOperationName in packages/server-utils/src/ai/workers-ai/utils.ts sends only typesafe/jev and @cf/cloudflare/clef to decide. A Clairic call ({state, fields}, no messages / prompt / text) falls through to chat. The result is a chat @cf/cloudflare/clairic span with no input or output messages.
To do
Bump @sentry/conventions when it has GEN_AI_EXTRACT (it is not in the package yet).
Send @cf/cloudflare/clairic to an extract operation: op gen_ai.extract, name extract {model}, gen_ai.operation.name: "extract".
gen_ai.input.messages: the request body as the caller passed it, without model. Replace each image with "[Blob substitute]".
gen_ai.output.messages: the response body as the provider returned it, without model and usage. Keep truncated.
Set gen_ai.usage.input_tokens / output_tokens. Do not send the other Clairic usage counts (state_tokens, image_tokens, schema_tokens, passes).
Add an integration test, and add an extract call to the Workers AI e2e app.
Activity
linear-code commentedon Oct 21, 2026
JS-3982
feat(server-utils): Record Workers AI Clairic calls as gen_ai.extract…
test(cloudflare): Add Workers AI E2E test for Clairic (#25625)
ref(server-utils): Use `GEN_AI_EXTRACT` op from `@sentry/conventions` (…
github-actions commentedon Oct 28, 2026
A PR closing this issue has just been released 🚀
This issue was referenced by PR #25625, which was included in the 11.10.0 release.