Skip to content

feat(node): Allow to force activate vercelAiIntegration #16551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025
Merged

Conversation

mydea
Copy link
Member

@mydea mydea commented Jun 11, 2025

By default, the instrumentation will register span processors only when the ai package is used. This is done to avoid overhead of span processing for users that do not even use this package.

However, it seems that in some environments, esp. in Next.js, the instrumentation is not added correctly, thus never running this, and not converting spans correctly. For now, this PR adds an escape hatch to manually opt-in to this to still get correct spans:

vercelAiIntegration({ force: true })

By default, the instrumentation will register span processors only when the ai package is used. This is done to avoid overhead of span processing for users that do not even use this package.

However, it seems that in some environments, esp. in Next.js, the instrumentation is not added correctly, thus never running this, and not converting spans correctly. For now, this PR adds an escape hatch to manually opt-in to this to still get correct spans:

```js
vercelAiIntegration({ force: true })
```
@mydea mydea requested review from Lms24, AbhiPrasad and chargome June 11, 2025 14:10
@mydea mydea self-assigned this Jun 11, 2025
@mydea mydea merged commit 88e3f8f into develop Jun 11, 2025
117 checks passed
@mydea mydea deleted the fn/ai-force branch June 11, 2025 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants