Uh oh!
There was an error while loading. Please reload this page.
feat(server-utils): Implement orchestrion-based instrumentation for vercel-ai v6 - #21658
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
9145703 to
abad3a9CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
size-limit report 📦
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
JPeer264
left a comment
There was a problem hiding this comment.
Haven't found any major issues. Tests are failing though and clanker has some objections
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| return isRecord(model) ? asString(model[field]) : undefined; | ||
| } | ||
| function asString(value: unknown): string | undefined { |
There was a problem hiding this comment.
super-l: Maybe it makes sense to outsource these functions in a helper? vercel-ai-dc-subscriber.ts is also using some of the helpers
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| // A single model instance shared by two concurrent `streamText` calls carries only one | ||
| // captured-parent slot, so both model calls must still land under their own `invoke_agent` — not | ||
| // collapse onto whichever operation resolved the shared model last. | ||
| test.skipIf(version === '7' && nodeVersion === 18)( |
There was a problem hiding this comment.
q: Why are we skipping this test on v7?
| * Like the v7 subscriber, each operation channel is wired up via | ||
| * {@link bindTracingChannelToSpan}, which binds the opened span into the runtime's | ||
| * async context for the duration of the traced call and ends it when the call | ||
| * settles. That binding is what lets the model call below find its enclosing | ||
| * `invoke_agent` span via the active context (see {@link resolveModelCallParent}). |
There was a problem hiding this comment.
nit: I'd drop this, it doesn't really add much for understanding, it explains bindTracingChannelToSpan which should already be explained elsewhere.
There was a problem hiding this comment.
this has all been refactored a bit and is hopefully easier/cleaner to understand now.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
f3e62c4 to
1731a89CompareThere was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1731a89. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This PR just splits up the orchestrion config for instrumentation into a file per instrumentation, making it a bit cleaner and easier to follow. This is on top of #21658

When using orchestrion, this replaces the regular
vercelAiIntegrationwith the channel-variant. This today supports vercel ai v6 and v7 (v5/v4 support TBD).Test coverage exists and everything passes. This does not add any event processors etc. anymore, everything works inside of the integrations.
OTEL Spans emitted directly by vercel-ai v6 or below are ignored to avoid double instrumentation.