Skip to content

test(node): Test vercelai errors are properly linked to parent span #17130

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

Closed
wants to merge 4 commits into from

Conversation

RulaKhaled
Copy link
Member

This adds tests to ensure Vercel AI errors properly inherit parent trace context.

Test Scenarios Added:

  • Manual span creation test (This is for non server environment where we don't already have an http server span the error could bubble up to)
  • Express HTTP request test (Tests realistic production scenario with Express server)


async function run() {
// Create a manual outer span (simulating the root span)
await Sentry.startSpan({ op: 'outer', name: 'outer span', description: 'outer span' }, async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description is an invalid field that does not exist anymore!


createEsmAndCjsTests(__dirname, 'scenario-error.mjs', 'instrument-with-pii.mjs', (createRunner, test) => {
test('Vercel AI errors should inherit parent trace context from manually created outer span', async () => {
let capturedTransaction: any;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: let's avoid any here and use the Event type :)

@RulaKhaled RulaKhaled marked this pull request as draft July 23, 2025 12:58
@RulaKhaled RulaKhaled closed this Jul 23, 2025
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