-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unnecessary
continueTrace
calls
- Loading branch information
1 parent
33fa050
commit 426ce94
Showing
7 changed files
with
107 additions
and
131 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
56 changes: 43 additions & 13 deletions
56
dev-packages/e2e-tests/test-applications/solidstart/tests/performance.server.test.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,55 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { waitForTransaction } from '@sentry-internal/test-utils'; | ||
import { | ||
SEMANTIC_ATTRIBUTE_SENTRY_OP, | ||
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, | ||
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, | ||
} from '@sentry/core'; | ||
|
||
test('sends a server action transaction', async ({ page }) => { | ||
test('sends a server action transaction on pageload', async ({ page }) => { | ||
const transactionPromise = waitForTransaction('solidstart', transactionEvent => { | ||
return transactionEvent?.transaction === 'getPrefecture'; | ||
return transactionEvent?.transaction === 'GET /users/6'; | ||
}); | ||
|
||
await page.goto('/users/6'); | ||
|
||
const transaction = await transactionPromise; | ||
|
||
expect(transaction).toMatchObject({ | ||
transaction: 'getPrefecture', | ||
tags: { runtime: 'node' }, | ||
transaction_info: { source: 'url' }, | ||
type: 'transaction', | ||
contexts: { | ||
trace: { | ||
op: 'function.server_action', | ||
origin: 'manual', | ||
}, | ||
}, | ||
expect(transaction.spans).toEqual( | ||
expect.arrayContaining([ | ||
expect.objectContaining({ | ||
description: 'getPrefecture', | ||
data: { | ||
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'function.server_action', | ||
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'manual', | ||
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route', | ||
}, | ||
}), | ||
]), | ||
); | ||
}); | ||
|
||
test('sends a server action transaction on client navigation', async ({ page }) => { | ||
const transactionPromise = waitForTransaction('solidstart', transactionEvent => { | ||
return transactionEvent?.transaction === 'POST getPrefecture'; | ||
}); | ||
|
||
await page.goto('/'); | ||
await page.locator('#navLink').click(); | ||
await page.waitForURL('/users/5'); | ||
|
||
const transaction = await transactionPromise; | ||
|
||
expect(transaction.spans).toEqual( | ||
expect.arrayContaining([ | ||
expect.objectContaining({ | ||
description: 'getPrefecture', | ||
data: { | ||
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'function.server_action', | ||
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'manual', | ||
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route', | ||
}, | ||
}), | ||
]), | ||
); | ||
}); |
This file contains 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
This file contains 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
46 changes: 19 additions & 27 deletions
46
packages/solidstart/src/server/withServerActionInstrumentation.ts
This file contains 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
This file contains 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