Repository navigation
feat(ai): add telemetry and lifecycle callbacks to experimental_extract - #25232
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dancer
marked this pull request as ready for review
November 18, 2026 20:25
aayush-kapoor
approved these changes
Nov 18, 2026
Contributor
|
🚀 Published in:
|
This was referenced Nov 21, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
background
experimental_extractshipped without telemetry,runtimeContextoronStart/onEnd, same as decide's first pr. this adds them the same way #21162 did for decide, matching how decide works today (context allowlists,aiVersion, recording flags in the tracing channel)summary
telemetry,runtimeContext,onStartandonEndtoexperimental_extractExperimental_ExtractStartEvent,Experimental_ExtractEndEvent,Experimental_ExtractionModelCallStartEventandExperimental_ExtractionModelCallEndEventexperimental_onExtractStart,experimental_onExtractionModelCallStart,experimental_onExtractionModelCallEndandexperimental_onExtractEndto telemetry integrations, kept out of the stableonStart/onEndunions like decideexperimental_extracttracing channel spanOpenTelemetryrecords anextract {modelId}operation span and a child model call span with usage and response id. state, fields, reference date and answers go underai.extraction.*behind a new opt-inexperimental_extractionoptionfieldsandreferenceDatefrom integrations whenrecordInputsis false, next to decide'squestions. both go into the model prompt. answers were already covered by theanswersoutput ruleonStart/onEndand the provider call still get them[redacted]for telemetry, since they can be signed links. the download andonStart/onEndstill use the originalsexperimental_extractreference and a telemetry section in the extractions guide, plus otel and tracing channel examplessame order as decide: invalid input and unsupported field types throw before any event, a refusal fires
onErrorand no end events, and the model call end event has the normalized answers that are validated and returnedleft out on purpose: no
LegacyOpenTelemetrysupport since legacy is fading out, and no deprecated hook aliases since extract never had old namesbundle limit goes from 661 to 664 kb, node is 662.87 kb
verification
otel example, both spans exported, model call span parented to the root
model call end event vs raw openai response, and a failing call
recordInputs false, gpt-6.2-sol
the integration and the tracing channel get no state, fields or reference date.
onStartstill gets everything and the extraction still uses the reference daterequest headers and provider options, gpt-6.2-sol
the provider still gets them, telemetry doesn't
tracingandintegrationare whether the event containedsecretsigned file url, real download, gpt-6.2-sol
the url has a fake
?sig=secretquery. one run succeeds, one hits a 10 byte download limittracing channel example
checklist
pnpm changesetin root)