Skip to content

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.

3 participants